From 1a9170d10b29ffa7b821fda53f7fe6f7a5536764 Mon Sep 17 00:00:00 2001 From: Evan Date: Tue, 10 Dec 2024 20:12:21 -0800 Subject: [PATCH] fix shellexecution deleting already inactive unit --- TODO.txt | 4 +++- src/client/graphics/layers/NameLayer.ts | 4 ---- src/core/execution/ShellExecution.ts | 4 ++++ 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/TODO.txt b/TODO.txt index bcfab6fe2..06d2806af 100644 --- a/TODO.txt +++ b/TODO.txt @@ -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 diff --git a/src/client/graphics/layers/NameLayer.ts b/src/client/graphics/layers/NameLayer.ts index d415595e9..f9ec68216 100644 --- a/src/client/graphics/layers/NameLayer.ts +++ b/src/client/graphics/layers/NameLayer.ts @@ -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') } } } diff --git a/src/core/execution/ShellExecution.ts b/src/core/execution/ShellExecution.ts index a22923f9a..e47f6ef67 100644 --- a/src/core/execution/ShellExecution.ts +++ b/src/core/execution/ShellExecution.ts @@ -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