validates coordinates in onMouseUp

This commit is contained in:
BeGj
2025-03-04 12:12:20 +00:00
parent a60bef97f0
commit 276eee1152
+3
View File
@@ -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);