PathFree

Category: Landscape
Since engine version: 4.6.5.0 CP

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 iX1, int iY1, int iX2, int iY2);

Parameters

iX1:
X coordinate of the start point
iY1:
Y coordinate of the start point
iX2:
X coordinate of the end point
iY2:
Y coordinate of the end point

Remark

All coordinates are global, even in local calls.

Example

protected func ControlSpecial2()
  {
  var i, pBase;
  while (pBase=FindBase(GetOwner(), i++))
    if (PathFree(GetX(), GetY(), GetX(pBase), GetY(pBase)))
      {
      Message("Ich sehe meine Basis!", this());
      break;
      }
  if (!pBase) Message("Ich sehe meine Basis nicht :/", this());
  }
Script of a special clonk: with key Special 2 he will tell you whether he can see one of his home bases.
See also: GBackSolid, GetMaterial, GetPathLength
Sven2, August 2002