object - commandobject - platoon


int IsTargetInCannonRange(int nUnit, int nCannonNum, unit uTarget))

Scope: private

Parameters
nUnit - unit number
nCannonNum - cannon number.
uTarget - checked target.

Return values
Walue which says about target 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 target uTarget for cannon number nCannonNum. If returns notInRange, inRangeBadAngleBeta or inRangeBadHit unit should movie to target direction, if returns inRangeBadAngleAlpha unit should turn to target direction, for inRangeGoodHit unit can start fire.

See also