Skip to content

Commit

Permalink
Store expansion distance in length not time (#242)
Browse files Browse the repository at this point in the history
  • Loading branch information
jzy-chitong56 authored Feb 10, 2024
1 parent 3acfce7 commit 2edd2c6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions common.eai
Original file line number Diff line number Diff line change
Expand Up @@ -6011,9 +6011,9 @@ function AddExpansion takes unit u, real d returns nothing
set expansion_dist[expansion_list_length] = d
set expansion_creeps[expansion_list_length] = GetExpFoeGroup(expansion_creeps[expansion_list_length],u) // group of the the creeps that guard this mine
if first_expansion_chosen == false then
set first_expansion_chosen = d * 522 >= front_base_distance and not CheckExpansionTaken(u)
set first_expansion_chosen = d > front_base_distance and not CheckExpansionTaken(u)
endif
if d > 6000 / 512 then
if d > 6000 then
call GroupAddUnit(far_expansion, u)
endif
set expansion_list_length = expansion_list_length + 1
Expand Down Expand Up @@ -6133,7 +6133,7 @@ function MakeExpansionList takes nothing returns nothing
call RemoveUnit(pather[i])
set pather[i] = null
set patherdone[i] = true
call AddExpansion(u, totaltime)
call AddExpansion(u, totaltime * 512)
//elseif GetUnitCurrentOrder(u) == OrderId("stop") then
//return (totaltime * -1)
elseif GetUnitState(pather[i], UNIT_STATE_LIFE) <= 0 then
Expand All @@ -6148,7 +6148,7 @@ function MakeExpansionList takes nothing returns nothing
call RemoveUnit(pather[i])
set pather[i] = null
set patherdone[i] = true
call AddWaterExpansion(u, DistanceBetweenPoints_kd(home_location, GetUnitLoc(u)) / 512)
call AddWaterExpansion(u, DistanceBetweenPoints_kd(home_location, GetUnitLoc(u)))
else
call IssuePointOrder(pather[i], "move", GetUnitX(u), GetUnitY(u)) // Try again?
endif
Expand Down

0 comments on commit 2edd2c6

Please sign in to comment.