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