Skip to content

Commit

Permalink
Removed invalid check that doesn't do whats expected
Browse files Browse the repository at this point in the history
  • Loading branch information
SMUnlimited committed Jan 21, 2024
1 parent 2676961 commit 6c924e7
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions common.eai
Original file line number Diff line number Diff line change
Expand Up @@ -11115,9 +11115,6 @@ function OneBuildLoopAM takes nothing returns nothing

// call EndDump(Int2Str(ai_time))

if ret == NOT_ENOUGH_RES and gold_buffer + wood_buffer == 0 and not hero_built[1] then // beginning of the game , if no resources build , build next unit , maybe next is peon
set index = index + 1
endif
loop
exitwhen index >= build_length
if index > 0 and ModuloInteger(index, 300) == 0 then
Expand Down

1 comment on commit 6c924e7

@jzy-chitong56
Copy link
Contributor

@jzy-chitong56 jzy-chitong56 commented on 6c924e7 Jan 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check is mainly used to handle the pause phenomenon of ELF at the beginning of the game
You will find that when all WISPs are working, the ELF will still continue to build tree or other -- but build queue next must not WIPS, because there is no WISP and WISP cannot be pulled out of the gold mine, it will cause construction lag--there is no WISP to execute, but the latest task in the queue is still tree building. If you skip this, you can train a new WISP to avoid getting stuck -- He doesn't lack money or wood, just doesn't have free WISP(harvest wood) to build, so the construction won't fail , He will continue with the construction after WISP completes a building -- if the WISP has not turned into a tree

Of course, the JOB collected now will pull WISP from the gold mine when the population has reached the limit, but this code can still work when the population has not reached the limit

You need a new logic to avoid this problem

Please sign in to comment.