object - commandobject - unit


unit FindClosestEnemyEx(int nTargetType)

Scope: private

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

Return values
Found unit or null if not found.

Description
This function searches for closest enemy object of type nTargetType staying in range of view.

See also
FindTarget, BuildTargetsArray, FindClosestEnemy, FindClosestEnemyUnitOrBuilding