Mirroar / hivemind

Fully automated open source AI core for the game screeps. Also usable as an opponent on private servers.
MIT License
29 stars 10 forks source link

Harvesters failing to spawn #58

Closed Morningtea7 closed 2 years ago

Morningtea7 commented 2 years ago

source.effects is not iterable when there is no applied effects. This would cause the initial harvesters failing to spawn. Fallback to use _.each() instead.

Mirroar commented 2 years ago

If that was the case, harvesters would only spawn when the source has an active effect. Where are you encountering this problem? On Screeps World, A private server, or xxscreeps?

Either way I have no problem making this compatible with source.effects being undefined, so this can be merged.

Morningtea7 commented 2 years ago

I encountered this problem in the World. The bot relocated the initial spawn at RCL 5. After relocation, most creeps died off of aging. Then the relocated spawn refuses to spawn any harvesters due to source.effects being uniterable. Using _.each() solved this issue.