From f489a3d8f4a37c52343ce858338b9567e9c30c85 Mon Sep 17 00:00:00 2001 From: Admin Date: Fri, 18 Sep 2026 00:58:12 +0000 Subject: [PATCH] Restore safe player hit impact FX --- src/game-v4.js | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/game-v4.js b/src/game-v4.js index 9303196..a37c621 100644 --- a/src/game-v4.js +++ b/src/game-v4.js @@ -533,7 +533,12 @@ class GameScene extends Phaser.Scene { // happens from the scene update after the physics step; projectile cleanup // remains on the normal lifetime path to avoid collision-time lifecycle changes. shot.setData('playerHitQueued', true); - this.pendingPlayerHits.push({ shot, damage }); + this.pendingPlayerHits.push({ + shot, + damage, + x: shot.x, + y: shot.y, + }); airshipLog('combat:player-hit-queued', { damage, @@ -571,6 +576,23 @@ class GameScene extends Phaser.Scene { this.playerHull = result.hull; this.lastPlayerHitAt = result.lastHitAt; + if (result.appliedHits > 0) { + const impact = hits[0]; + try { + this.spawnExplosion(impact.x, impact.y, 0.32); + this.flashShip(this.player, 0xffcccc); + airshipLog('combat:player-hit-fx', { + x: Math.round(impact.x), + y: Math.round(impact.y), + scale: 0.32, + }, 'debug'); + } catch (error) { + airshipLog('combat:player-hit-fx-error', { + message: error?.message || String(error), + }, 'error'); + } + } + airshipLog('combat:player-hit-processed', { queuedHits: hits.length, appliedHits: result.appliedHits,