From ee4b91a422a821b444731d5a18be20d75cee614d Mon Sep 17 00:00:00 2001 From: Vivacious Box Date: Thu, 22 Jan 2026 00:13:55 +0100 Subject: [PATCH] Fix nuke telegraph for allies (#2983) ## Description: Adds back the nuke overlay for teammates ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced ## Please put your Discord username so you can be contacted if a bug or regression is found: Mr. Box --- src/client/graphics/layers/DynamicUILayer.ts | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/client/graphics/layers/DynamicUILayer.ts b/src/client/graphics/layers/DynamicUILayer.ts index affd9f0f4..b151a1b83 100644 --- a/src/client/graphics/layers/DynamicUILayer.ts +++ b/src/client/graphics/layers/DynamicUILayer.ts @@ -116,14 +116,25 @@ export class DynamicUILayer implements Layer { } onBombEvent(unit: UnitView) { - if (this.createdThisTick(unit) && this.isOwnedByPlayer(unit)) { + const myPlayer = this.game.myPlayer(); + if (!myPlayer) { + return; + } + if ( + this.createdThisTick(unit) && + (unit.owner() === myPlayer || unit.owner().isOnSameTeam(myPlayer)) + ) { const target = new NukeTelegraph(this.transformHandler, this.game, unit); this.uiElements.push(target); } } onTransportShipEvent(unit: UnitView) { - if (this.createdThisTick(unit) && this.isOwnedByPlayer(unit)) { + const myPlayer = this.game.myPlayer(); + if (!myPlayer) { + return; + } + if (this.createdThisTick(unit) && unit.owner() === myPlayer) { const target = new NavalTarget(this.transformHandler, this.game, unit); this.uiElements.push(target); } @@ -146,11 +157,6 @@ export class DynamicUILayer implements Layer { } } - private isOwnedByPlayer(unit: UnitView): boolean { - const my = this.game.myPlayer(); - return my !== null && unit.owner() === my; - } - private createdThisTick(unit: UnitView): boolean { return unit.createdAt() === this.game.ticks(); }