Added a cancellation check

This commit is contained in:
Ryan Barlow
2026-01-08 15:50:38 +00:00
parent 4694add4d0
commit 2fa03b1d9d
@@ -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) {