# AIHasNearbyAlliedAttackers
Flags —
Native
# Arguments
int
— playerpoint
— locfixed
— range
Returns — bool
native bool AIHasNearbyAlliedAttackers(
int player,
point loc,
fixed range,
);
# Related
Category: Unclassified
# Examples
mods/core.sc2mod — base.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:1251
// must have allies nearby that could attack
if (!AIHasNearbyAlliedAttackers(player, UnitGetPosition(aiUnit), 12.0)) {
return null;
}
mods/core.sc2mod — base.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:1307
// must have allies nearby that could attack
if (!AIHasNearbyAlliedAttackers(player, UnitGetPosition(aiUnit), 12.0)) {
return null;
}
mods/core.sc2mod — base.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:1073
}
if (needsNearbyAttackers && !AIHasNearbyAlliedAttackers(player, loc, 10.0)) {
return false;
}
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:1210
// must have allies nearby that could attack
if (!AIHasNearbyAlliedAttackers(player, UnitGetPosition(aiUnit), 12.0)) {
return null;
}
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:1053
}
if (needsNearbyAttackers && !AIHasNearbyAlliedAttackers(player, loc, 10.0)) {
return false;
}
mods/warcoop/warclassicsystem.sc2mod — base.sc2data/TriggerLibs/Tactical/TacticalAIWar3.galaxy:328
}
}
if (needsNearbyAttackers && !AIHasNearbyAlliedAttackers(player, loc, 10.0)) {
return false;
}