From 2fa03b1d9de26915acad279822fea6a6cef48ed1 Mon Sep 17 00:00:00 2001 From: Ryan Barlow Date: Thu, 8 Jan 2026 15:50:38 +0000 Subject: [PATCH] Added a cancellation check --- src/client/graphics/layers/GhostStructureManager.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/client/graphics/layers/GhostStructureManager.ts b/src/client/graphics/layers/GhostStructureManager.ts index 8851a390f..b40e7c5b9 100644 --- a/src/client/graphics/layers/GhostStructureManager.ts +++ b/src/client/graphics/layers/GhostStructureManager.ts @@ -174,10 +174,14 @@ export class GhostStructureManager { } } + const currentGhost = this.ghostUnit; this.game .myPlayer() ?.actions(tileRef) .then((actions) => { + // Check if ghost is still valid and hasn't changed + if (!this.ghostUnit || this.ghostUnit !== currentGhost) return; + // Clear previous highlights/filters this.onHighlightUpgrade(null); if (this.ghostUnit?.container) {