From 276eee11523c6aab7776d41da687f4e2cb5b65d5 Mon Sep 17 00:00:00 2001 From: BeGj Date: Tue, 4 Mar 2025 12:12:20 +0000 Subject: [PATCH] validates coordinates in onMouseUp --- src/client/graphics/layers/UnitLayer.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/client/graphics/layers/UnitLayer.ts b/src/client/graphics/layers/UnitLayer.ts index 57f34ae9f..1f8b2d23f 100644 --- a/src/client/graphics/layers/UnitLayer.ts +++ b/src/client/graphics/layers/UnitLayer.ts @@ -118,6 +118,9 @@ export class UnitLayer implements Layer { event.x, event.y, ); + if (!this.game.isValidCoord(cell.x, cell.y)) { + return; + } // Find warships near this cell, sorted by distance const nearbyWarships = this.findWarshipsNearCell(cell);