Skip to content

Commit

Permalink
Small further tweaks to double expansion
Browse files Browse the repository at this point in the history
  • Loading branch information
SMUnlimited committed Mar 8, 2024
1 parent 78d0e13 commit c626837
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Jobs/BUILD_EXPANSION.eai
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@


// Extra prevention against AMAI building two townhalls at the same location
// GetotherExpansionNearby dosn't yet detect haunted mines so they are still the exception
function BuildExpansionJob takes unit u, unit expansion returns nothing
local unit v = null
local player p = null
Expand All @@ -12,6 +11,7 @@ function BuildExpansionJob takes unit u, unit expansion returns nothing
return
endif
if expansion == null then
call IssueImmediateOrder(u, "stop")
return
endif
set d = DistanceBetweenUnits(u, expansion)
Expand All @@ -20,7 +20,7 @@ function BuildExpansionJob takes unit u, unit expansion returns nothing
call Trace("Build Expansion JOB has order")
if CheckDoubleExpansionsClaimedInArea(GetUnitX(expansion), GetUnitY(expansion), true) then
if double_expansion_ally_present then
call Trace("Cancelling Expansion - Enemy ally expansion detected")
call Trace("Cancelling Expansion - ally expansion detected")
call IssueImmediateOrder(u, "stop")
return
endif
Expand All @@ -37,7 +37,6 @@ function BuildExpansionJob takes unit u, unit expansion returns nothing
call Trace("Build Expansion JOB Retry Check")
if CheckDoubleExpansionsClaimedInArea(GetUnitX(expansion), GetUnitY(expansion), true) then
if not double_own_present and not double_expansion_ally_present and double_expansion_enemy_present and GetLocationNonCreepStrength(GetUnitX(u), GetUnitY(u), race_max_expa_mine_distance) == 0 then
call IssueImmediateOrder(u, "stop")
set v = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), old_id[racial_expansion], GetUnitX(expansion), GetUnitY(expansion), 270.0)
if DistanceBetweenPoints_dd(GetUnitLoc(v), GetUnitLoc(expansion)) <= race_max_expa_mine_distance then
call IssuePointOrderById(u, old_id[racial_expansion], GetUnitX(v), GetUnitY(v))
Expand Down

0 comments on commit c626837

Please sign in to comment.