#1086 prevent clicking on other structures than your own (#1087)

## Description:
Prevent opening UnitInfoModal for other structures than your own

## Please complete the following:

- [X] I have added screenshots for all UI updates
- [X] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [X] I have added relevant tests to the test directory
- [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

## Please put your Discord username so you can be contacted if a bug or
regression is found:

maxion_
This commit is contained in:
Max Lundgren
2025-06-07 22:09:30 +03:00
committed by GitHub
parent 9cfbd80d12
commit 13fd2743ed
@@ -368,6 +368,9 @@ export class StructureLayer implements Layer {
this.previouslySelected = this.selectedStructureUnit;
if (clickedUnit) {
if (clickedUnit.owner() !== this.game.myPlayer()) {
return;
}
const wasSelected = this.previouslySelected === clickedUnit;
if (wasSelected) {
this.selectedStructureUnit = null;