fix shellexecution deleting already inactive unit

This commit is contained in:
Evan
2024-12-10 20:12:21 -08:00
parent d5f6a9c1e4
commit 1a9170d10b
3 changed files with 7 additions and 5 deletions
+3 -1
View File
@@ -229,11 +229,13 @@
* alert on unit captured or destroyed 12/20/2024
* only check islands/clusters when being attacked DONE 12/10/2024
* only calculate name if tile changes DONE 12/10/2024
* allow longer names and allow them to be displayed in the Rank UI not be cut
* store in BigQuery
* allow longer names and allow them to be displayed in the Rank UI not be cut
* make boats work on lakes (& oceania)
* record game winner
* add panama canal NA
* repaint canvas after tab away to prevent blank screen
* on mobile can't click away from build menu
* replay stored games
* record commit hash of game
* remove alliance when player dies
-4
View File
@@ -95,16 +95,12 @@ export class NameLayer implements Layer {
render.lastBoundingCalculated = now
if (shouldRecalc) {
render.boundingBox = calculateBoundingBox(render.player.borderTiles());
} else {
console.log('skipping box calculation')
}
}
if (render.isVisible && now - render.lastRenderCalc > this.refreshRate) {
render.lastRenderCalc = Date.now() + this.rand.nextInt(0, 100)
if (shouldRecalc) {
this.calculateRenderInfo(render)
} else {
console.log('skipping name render')
}
}
}
+4
View File
@@ -20,6 +20,10 @@ export class ShellExecution implements Execution {
if (this.shell == null) {
this.shell = this._owner.buildUnit(UnitType.Shell, 0, this.spawn)
}
if (!this.shell.isActive()) {
this.active = false
return
}
if (!this.target.isActive()) {
this.shell.delete()
this.active = false