From 13fd2743ed40f5ce6e3a7987f8972c00dfcabcd5 Mon Sep 17 00:00:00 2001 From: Max Lundgren Date: Sat, 7 Jun 2025 22:09:30 +0300 Subject: [PATCH] #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_ --- src/client/graphics/layers/StructureLayer.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/client/graphics/layers/StructureLayer.ts b/src/client/graphics/layers/StructureLayer.ts index f8ce3db82..180005d26 100644 --- a/src/client/graphics/layers/StructureLayer.ts +++ b/src/client/graphics/layers/StructureLayer.ts @@ -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;