Skip to content

Commit

Permalink
Fix the expansion hashtables plus add changelog entry #246
Browse files Browse the repository at this point in the history
  • Loading branch information
SMUnlimited committed Feb 18, 2024
1 parent 012321a commit e642590
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Some mining irregularity fixes.
- Fix water expansion distance not calculated correctly. (jzy-chitong56)
- In certain languages if translated chat messages with variable placeholders cannot be parsed at least still return the message rather than complete nonsense.
- Fixed an issue where only a specific creep needs to be killed for AMAI to think mines and neutral buildings were unguarded going forwards.
- (Classic) Fixed game start crash with AMAI vs AI. (jzy-chitong56)
- (Classic) Fixed some TFT settings not in sync with REFORGED.
- (DevTools) Fixed the optimize all script and the makeAll and optimizeAll scripts will pause between versions.
Expand Down
10 changes: 7 additions & 3 deletions common.eai
Original file line number Diff line number Diff line change
Expand Up @@ -6032,7 +6032,7 @@ function AddExpansion takes unit u, real d returns nothing
call DestroyGroup(g)
set g = null
set creep = null
call SaveInteger(com, expansion_list_length, 0, i) // Store size in first element
call SaveInteger(expansion_creeps, expansion_list_length, 0, i) // Store size in first element
if first_expansion_chosen == false then
set first_expansion_chosen = d > front_base_distance and not CheckExpansionTaken(u)
endif
Expand Down Expand Up @@ -6061,7 +6061,7 @@ function AddWaterExpansion takes unit u, real d returns nothing
call DestroyGroup(g)
set g = null
set creep = null
call SaveInteger(com, water_expansion_list_length, 0, i) // Store size in first element
call SaveInteger(water_expansion_creeps, water_expansion_list_length, 0, i) // Store size in first element
set water_expansion_list_length = water_expansion_list_length + 1
endfunction

Expand Down Expand Up @@ -6627,6 +6627,7 @@ function GetExpFoe takes unit nearunit returns unit
set t = water_expansion_creeps
endif
if LoadInteger(t, current_expansion_creeps , 0) == 0 then
call Trace("GetExpFoe: No creeps in current expansion")
return null
endif
set l = GetUnitLoc(current_expansion)
Expand All @@ -6647,7 +6648,10 @@ function GetExpFoe takes unit nearunit returns unit
call RemoveLocation(l)
set l = null
set t = null
//call Trace("Have a foe")
set u = null
if nearunit != null then
//call Trace("GetExpFoe: Have a foe")
endif
return nearunit
endfunction

Expand Down

0 comments on commit e642590

Please sign in to comment.