mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 14:40:27 +00:00
don't delete nukes when player dies. was creating a an error because nukeexecution tried deleting inactive unit.
This commit is contained in:
@@ -108,9 +108,6 @@ export class NukeExecution implements Execution {
|
||||
}
|
||||
}
|
||||
}
|
||||
// this.mg.units()
|
||||
// .filter(b => euclideanDist(this.cell, b.tile().cell()) < this.magnitude + 50)
|
||||
// .forEach(b => b.delete())
|
||||
this.active = false
|
||||
this.nuke.delete(false)
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Config } from "../configuration/Config"
|
||||
import { Execution, MutableGame, MutablePlayer, Player, PlayerID, TerraNullius, Tile } from "../game/Game"
|
||||
import { Execution, MutableGame, MutablePlayer, Player, PlayerID, TerraNullius, Tile, UnitType } from "../game/Game"
|
||||
import { bfs, calculateBoundingBox, getMode, inscribed, simpleHash } from "../Util"
|
||||
import { GameImpl } from "../game/GameImpl"
|
||||
import { consolex } from "../Consolex"
|
||||
@@ -48,7 +48,11 @@ export class PlayerExecution implements Execution {
|
||||
})
|
||||
|
||||
if (!this.player.isAlive()) {
|
||||
this.player.units().forEach(u => u.delete())
|
||||
this.player.units().forEach(u => {
|
||||
if (u.type() != UnitType.AtomBomb && u.type() != UnitType.HydrogenBomb) {
|
||||
u.delete()
|
||||
}
|
||||
})
|
||||
this.active = false
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user