From 39c13fbeb4f4a770dae16f6eca644947bf034c94 Mon Sep 17 00:00:00 2001 From: Admin Date: Fri, 18 Sep 2026 00:40:19 +0000 Subject: [PATCH] Use tested queued hit processor --- src/game-v4.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/game-v4.js b/src/game-v4.js index d284092..2d93ac6 100644 --- a/src/game-v4.js +++ b/src/game-v4.js @@ -3,7 +3,7 @@ import './style.css'; import airshipSheetUrl from './assets/airships.svg?url'; import explosionSheetUrl from './assets/explosions.svg?url'; import { airshipLog, registerDebugSnapshot } from './diagnostics.js'; -import { normalizePlayerDamage, reducePlayerHitQueue } from './game-logic.js'; +import { normalizePlayerDamage, processQueuedPlayerHits } from './game-logic.js'; const WORLD_SIZE = 2400; const PLAYER_MAX_SPEED = 180; @@ -534,16 +534,12 @@ class GameScene extends Phaser.Scene { const hits = this.pendingPlayerHits; this.pendingPlayerHits = []; - for (const { shot } of hits) { - if (shot?.active) shot.destroy(); - } - const beforeHull = this.playerHull; - const result = reducePlayerHitQueue({ + const result = processQueuedPlayerHits({ hull: this.playerHull, lastHitAt: this.lastPlayerHitAt, now: this.time.now, - damages: hits.map(({ damage }) => damage), + hits, cooldownMs: PLAYER_HIT_COOLDOWN_MS, maxHull: PLAYER_MAX_HULL, });