PathFree2

Category: Landscape
Since engine version: 1.0 OC

Description

Works like PathFree, but instead returns an array containing the coordinates of the first solid pixel found on line. Returns nil if the path is free.

Syntax

array PathFree2(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

var x = Random(LandscapeWidth()),
	pos = PathFree2(x, 0, x, LandscapeHeight());
if(pos)
	CreateObject(Idol, pos[0], pos[1]);
Creates an Idol somewhere on the surface of the landscape.
See also: GBackSolid, GetMaterial, GetPathLength, PathFree
Apfelclonk, 2014-04