Context
During spawn phase, nukes are blocked via isSpawnImmunityActive() checks in nukeSpawn(), but structure spawning methods (landBasedStructureSpawn, portSpawn) lack equivalent guards.
NationExecution (which is active during spawn phase via activeDuringSpawnPhase() => true) calls structureBehavior.handleStructures(), which then calls player.canBuild() for structures. This allows structures to be queued for construction during spawn phase via the nation AI path.
Proposed Solution
Add isSpawnImmunityActive() checks to structure spawn methods to match nuke behavior:
- Either check inside
canBuild() before calling canSpawnUnitType() for structure types
- Or add early-return checks to
landBasedStructureSpawn() and portSpawn() (mirroring nukeSpawn())
References
Context
During spawn phase, nukes are blocked via
isSpawnImmunityActive()checks innukeSpawn(), but structure spawning methods (landBasedStructureSpawn,portSpawn) lack equivalent guards.NationExecution(which is active during spawn phase viaactiveDuringSpawnPhase() => true) callsstructureBehavior.handleStructures(), which then callsplayer.canBuild()for structures. This allows structures to be queued for construction during spawn phase via the nation AI path.Proposed Solution
Add
isSpawnImmunityActive()checks to structure spawn methods to match nuke behavior:canBuild()before callingcanSpawnUnitType()for structure typeslandBasedStructureSpawn()andportSpawn()(mirroringnukeSpawn())References
nukeSpawnblocks during spawn at line ~1194 insrc/core/game/PlayerImpl.ts