From 22ae882032f0c304a34d4634b5ef76097a9b8daf Mon Sep 17 00:00:00 2001 From: Pax1601 Date: Fri, 17 Nov 2023 17:45:10 +0100 Subject: [PATCH] Unit gets forcefully deselected when hidden --- client/src/unit/unit.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/src/unit/unit.ts b/client/src/unit/unit.ts index cba3ca14..28b3f2d3 100644 --- a/client/src/unit/unit.ts +++ b/client/src/unit/unit.ts @@ -686,7 +686,10 @@ export abstract class Unit extends CustomMarker { (this.belongsToCommandedCoalition() || (!this.belongsToCommandedCoalition() && this.#detectionMethods.length == 0)))); /* Force dead units to be hidden */ - this.setHidden(hidden || !this.#alive); + this.setHidden(hidden || !this.getAlive()); + + /* Force hidden units to be unselected */ + this.setSelected(this.getSelected() && !this.getHidden()); } setHidden(hidden: boolean) {