mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-23 00:24:04 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user