diff --git a/src/core/execution/NationExecution.ts b/src/core/execution/NationExecution.ts index 785aa41e9..6a2a53a7d 100644 --- a/src/core/execution/NationExecution.ts +++ b/src/core/execution/NationExecution.ts @@ -28,6 +28,7 @@ export class NationExecution implements Execution { private active = true; private random: PseudoRandom; private behaviorsInitialized = false; + private spawnExecAdded = false; private emojiBehavior!: NationEmojiBehavior; private mirvBehavior!: NationMIRVBehavior; private attackBehavior!: AiAttackBehavior; @@ -104,7 +105,14 @@ export class NationExecution implements Execution { } if (this.mg.inSpawnPhase()) { - if (ticks % this.attackRate !== this.attackTick) { + if (this.player.hasSpawned()) { + // Already on the map — periodically re-spawn so the nation + // visibly hops to different locations during the spawn phase. + if (ticks % this.attackRate !== this.attackTick) { + return; + } + } else if (this.spawnExecAdded) { + // First SpawnExecution already queued, wait for it to land. return; } // Place nations without a spawn cell (Dynamically created for HumansVsNations) randomly by SpawnExecution @@ -112,6 +120,7 @@ export class NationExecution implements Execution { this.mg.addExecution( new SpawnExecution(this.gameID, this.nation.playerInfo), ); + this.spawnExecAdded = true; return; } @@ -131,6 +140,7 @@ export class NationExecution implements Execution { this.mg.addExecution( new SpawnExecution(this.gameID, this.nation.playerInfo), ); + this.spawnExecAdded = true; return; } } @@ -147,6 +157,7 @@ export class NationExecution implements Execution { this.mg.addExecution( new SpawnExecution(this.gameID, this.nation.playerInfo, rl), ); + this.spawnExecAdded = true; return; }