PathFree

Category: Landscape
Since engine version: 1.0 OC

Description

Determines whether the path from the start point to the end point is free, meaning that no solid material is intersected by a directly line between those points.

Syntax

bool PathFree(int x1, int y1, int x2, int y2);

Parameters

x1:
X coordinate of the start point
y1:
Y coordinate of the start point
x2:
X coordinate of the end point
y2:
Y coordinate of the end point

Remark

All coordinates are global, even in local calls.

Example

// for all living beings in a circle with a radius of 500 around it
for(var living in FindObjects(Find_OCF(OCF_Alive),Find_Distance(500)))
{
	// incinerate if the path is free
	if(PathFree(GetX(),GetY(),GetX(living),GetY(living)))
		living->Incinerate();
}
Eye of the beholder: Incinerates all living beings in a distance of maximum 500 pixels and if the beholder has a line-of-sight to it.
See also: GBackSolid, GetMaterial, GetPathLength, PathFree2
Sven2, 2002-08