# AIPathDistToNearestKnownEnemyStructure
Flags —
Native
# Arguments
int
— playerpoint
— locbool
— onlyDropoffs
Returns — int
native int AIPathDistToNearestKnownEnemyStructure(
int player,
point loc,
bool onlyDropoffs,
);
# Related
Category: Unclassified
# Examples
mods/core.sc2mod — base.sc2data/TriggerLibs/MeleeWaveAI.galaxy:532
leaderPos = UnitGetPosition(leader);
distEnemy = AIPathDistToNearestKnownEnemyStructure(player, leaderPos, true);
distFriend = AIPathDistToNearestFriendlyStructure(player, leaderPos, true);
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:1272
}
distToEnemy = AIPathDistToNearestKnownEnemyStructure(player, UnitGetPosition(aiUnit), true);//DistanceBetweenPoints(UnitGetPosition(aiUnit), PlayerStartLocation(RandomInt(1,2)));
if (distToEnemy >= 60) {
return null;
mods/warcoop/warmeleeai.sc2mod — base.sc2data/TriggerLibs/MeleeWaveAI.galaxy:622
leaderPos = UnitGetPosition(leader);
distEnemy = AIPathDistToNearestKnownEnemyStructure(player, leaderPos, true);
distFriend = AIPathDistToNearestFriendlyStructure(player, leaderPos, true);