# AIPathDistToNearestKnownEnemyStructure

FlagsNative

# Arguments

  • int — player
  • point — loc
  • bool — onlyDropoffs

Returns — int

native int AIPathDistToNearestKnownEnemyStructure(
	int player,
	point loc,
	bool onlyDropoffs,
);

Category: Unclassified

# Examples

mods/core.sc2modbase.sc2data/TriggerLibs/MeleeWaveAI.galaxy:532


    leaderPos = UnitGetPosition(leader);
    distEnemy = AIPathDistToNearestKnownEnemyStructure(player, leaderPos, true);
    distFriend = AIPathDistToNearestFriendlyStructure(player, leaderPos, true);

mods/starcoop/starcoop.sc2modbase.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.sc2modbase.sc2data/TriggerLibs/MeleeWaveAI.galaxy:622


    leaderPos = UnitGetPosition(leader);
    distEnemy = AIPathDistToNearestKnownEnemyStructure(player, leaderPos, true);
    distFriend = AIPathDistToNearestFriendlyStructure(player, leaderPos, true);