CheckLOS

Check LineOfSight-LOS between 2 point.

Params:

Pascal

function CheckLOS(xf : Integer; yf : Integer; zf : Integer; xt : Integer; yt : Integer; zt : Integer; WorldNum : Byte) : Boolean;

LOSOptions setted by PS variable, named “LOSOptions”. Its not a parameter of this method!

LOSOptions MUST BE set before calling CheckLOS!

LOSOptions value can be:

losTypeSphere = 1;

losTypeSphereAdv = 2;

losTypeRunUO = 3;

losTypePOL = 4;

and modifiers:

losSphereCheckCorners = 256; //actual only for Sphere

losPolUseNoShoot= 512; //actual only for POL

losPolLOSThroughWindow = 1024; //actual only for POL

Example:

begin
LOSOptions := losTypePOL OR losPolUseNoShoot;
CheckLOS(GetX(Self),GetY(Self),GetZ(Self),GetX(Self)+10,GetY(Self)+10,GetZ(Self),WorldNum);
end.

Python

CheckLOS(xf, yf, zf, xt, yt, zt, WorldNum, LOSCheckType, LOSOptions=None) -> Boolean

Example Python

CheckLOS(GetX(Self),GetY(Self),GetZ(Self),GetX(Self)+10,GetY(Self)+10,GetZ(Self),WorldNum, "Pol", {"PolUseNoShoot", "PolLosThroughWindow"});