object - commandobject - platoon


int IsPointInCannonRange(int nUnit, int nCannonNum, int nX, int nY, int nZ)

Scope: private

Parameters
nUnit - unit number
nCannonNum - cannon number.
nX - X-coordinate of target point.
nY - Y-coordinate of target point.
nZ - Y-coordinate of target point.

Return values
Walue which says about point location relative to us (for cannon number nCannonNum):
notInRange - target out of range,
inRangeBadAngleAlpha - target in range, but bad alpha angle,
inRangeBadAngleBeta - target in range, but bad beta angle (e.g. plane is too high and barrel cant be turn in it direction),
inRangeBadHit - target in range and good angles, but there is something between cannon and target,
inRangeGoodHit - target in range and can be hit.

Description
This function checks range to point (nX, nY, nZ) for cannon number nCannonNum. If returns notInRange, inRangeBadAngleBeta or inRangeBadHit unit should movie to point direction, if returns inRangeBadAngleAlpha unit should turn to point direction, for inRangeGoodHit unit can start fire.

See also