Closed Morningtea7 closed 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.
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.
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.