# PointsInRange

FlagsNative

# Arguments

  • point — p1
  • point — p2
  • fixed — range

Returns — bool

native bool PointsInRange(point p1, point p2, fixed range);

Category: Unclassified

# Examples

campaigns/liberty.sc2campaignbase.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:136

        loop = loop - 1;

        if (PointsInRange(UnitGetPosition(unitToCheck), loc, barrageRadius)) {
            enemyInBarrage = true;
            break;

campaigns/swarm.sc2campaignbase.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:136

        loop = loop - 1;

        if (PointsInRange(UnitGetPosition(unitToCheck), loc, barrageRadius)) {
            enemyInBarrage = true;
            break;

mods/core.sc2modbase.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:992

    }

    if (!PointsInRange(UnitGetPosition(aiUnit), AIGetHomePosition(aiUnit), c_warpPrismPhaseRange)) {
        return;
    }

mods/core.sc2modbase.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.sc2modbase.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.sc2modbase.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.sc2modbase.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:486

        loop = loop - 1;

        if (PointsInRange(UnitGetPosition(unitToCheck), loc, barrageRadius)) {
            enemyInBarrage = true;
            break;

mods/starcoop/starcoop.sc2modbase.sc2data/TriggerLibs/Tactical/TactCampAI.galaxy:1554

        loop = loop - 1;

        if (PointsInRange(UnitGetPosition(unitToCheck), loc, barrageRadius)) {
            enemyInBarrage = true;
            break;

mods/starcoop/starcoop.sc2modbase.sc2data/TriggerLibs/Tactical/TactProtAI.galaxy:962

    }

    if (!PointsInRange(UnitGetPosition(aiUnit), AIGetHomePosition(aiUnit), c_warpPrismPhaseRange)) {
        return;
    }

mods/starcoop/starcoop.sc2modbase.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.sc2modbase.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.sc2modbase.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;
            }