object - commandobject - unit


unit FindClosestEnemyUnitOrBuilding(int nTargetType)

Scope: private

Parameters
nTargetType - combination of following values:
findTargetWaterUnit - ship,
findTargetFlyingUnit - flying unit,
findTargetNormalUnit - land unit,
findTargetAnyUnit - any of aboves,
findTargetWall - wall ED or UCS,
findTargetBuildingRuin - building ruin.

Return values
Found unit or null if not found.

Description
This function search for closest unit of type nTargetType in range of view or building if there no such a unit.

See also
FindTarget, BuildTargetsArray, FindClosestEnemy, FindClosestEnemyEx