# PointsInRange
Flags —
Native
# Arguments
point
— p1point
— p2fixed
— range
Returns — bool
native bool PointsInRange(point p1, point p2, fixed range);
# Related
Category: Unclassified
# Examples
campaigns/liberty.sc2campaign — base.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:136
loop = loop - 1;
if (PointsInRange(UnitGetPosition(unitToCheck), loc, barrageRadius)) {
enemyInBarrage = true;
break;
campaigns/swarm.sc2campaign — base.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:136
loop = loop - 1;
if (PointsInRange(UnitGetPosition(unitToCheck), loc, barrageRadius)) {
enemyInBarrage = true;
break;
mods/core.sc2mod — base.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:992
}
if (!PointsInRange(UnitGetPosition(aiUnit), AIGetHomePosition(aiUnit), c_warpPrismPhaseRange)) {
return;
}
mods/core.sc2mod — base.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:1016
if (type == c_PU_WarpPrismPhasing) {
if (AIGetHomePosition(aiUnit) != c_nullPoint) {
if (PointsInRange(UnitGetPosition(aiUnit), AIGetHomePosition(aiUnit), c_warpPrismPhaseRange)) {
// we're supposed to provide power at this point
return;
mods/core.sc2mod — base.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:172
loop = loop - 1;
if (PointsInRange(UnitGetPosition(unitToCheck), loc, barrageRadius)) {
// found at least one enemy in the barrage area
return;
mods/core.sc2mod — base.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:823
}
// Unit's home point is too far away
else if (!PointsInRange(UnitGetPosition(aiUnit), AIGetHomePosition(unitToCheck), c_campaignBunkerLoadRange)) {
wantsToBeInBunker = false;
}
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:486
loop = loop - 1;
if (PointsInRange(UnitGetPosition(unitToCheck), loc, barrageRadius)) {
enemyInBarrage = true;
break;
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:1554
loop = loop - 1;
if (PointsInRange(UnitGetPosition(unitToCheck), loc, barrageRadius)) {
enemyInBarrage = true;
break;
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:962
}
if (!PointsInRange(UnitGetPosition(aiUnit), AIGetHomePosition(aiUnit), c_warpPrismPhaseRange)) {
return;
}
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:986
if (type == c_PU_WarpPrismPhasing) {
if (AIGetHomePosition(aiUnit) != c_nullPoint) {
if (PointsInRange(UnitGetPosition(aiUnit), AIGetHomePosition(aiUnit), c_warpPrismPhaseRange)) {
// we're supposed to provide power at this point
return;
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:175
loop = loop - 1;
if (PointsInRange(UnitGetPosition(unitToCheck), loc, barrageRadius)) {
// found at least one enemy in the barrage area
return;
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:799
}
// Unit's home point is too far away
else if (!PointsInRange(UnitGetPosition(aiUnit), AIGetHomePosition(unitToCheck), c_campaignBunkerLoadRange)) {
wantsToBeInBunker = false;
}