Garry's Mod Wiki

CNavArea:GetAdjacentAreaDistances

  table CNavArea:GetAdjacentAreaDistances( number dir = nil )

Description

Returns a list of all the CNavAreas that have a one-way connection to this CNavArea and their pre-computed distances.

If an area has a one-way incoming connection to this CNavArea, then it will not be returned from this function, use CNavArea:GetIncomingConnectionDistances to get all one-way incoming connections.

Arguments

1 number dir = nil
If set, will only return areas in the specified direction. See NAVDIR enum.

Returns

1 table
A list of tables in the following format:
  • CNavArea area - the area that is connected to this area.
  • number dist - Distance from the area to this area.
  • number dir - Direction in which the area is in relative to this area.