bug: Clicking out of bounds throws uncaught exception (#920)

## Description:

Fix invalid tile error when clicking out of bounds.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
This commit is contained in:
Scott Anderson
2025-05-28 05:09:15 -04:00
committed by GitHub
parent b6596c88ee
commit da862a1ec9
@@ -360,6 +360,9 @@ export class StructureLayer implements Layer {
event.x,
event.y,
);
if (!this.game.isValidCoord(cell.x, cell.y)) {
return;
}
const clickedUnit = this.findStructureUnitAtCell(cell);
this.previouslySelected = this.selectedStructureUnit;