From f979e6da0f0baa765a38ad65f74115627e29dc55 Mon Sep 17 00:00:00 2001 From: Thomas Christlieb Date: Tue, 16 Jan 2024 16:13:11 +0100 Subject: [PATCH] Don't allow to unspy a spy by clicking on itself --- OpenRA.Mods.Cnc/Traits/Disguise.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OpenRA.Mods.Cnc/Traits/Disguise.cs b/OpenRA.Mods.Cnc/Traits/Disguise.cs index 72edcb00e9..fd2478a571 100644 --- a/OpenRA.Mods.Cnc/Traits/Disguise.cs +++ b/OpenRA.Mods.Cnc/Traits/Disguise.cs @@ -304,6 +304,9 @@ namespace OpenRA.Mods.Cnc.Traits if (!info.ValidRelationships.HasRelationship(relationship)) return false; + if (target.Equals(self)) + return false; + return info.TargetTypes.Overlaps(target.GetAllTargetTypes()); }