From 1a968588b6389cbe0c4e6b6b27d1dc55d3ad1c8e Mon Sep 17 00:00:00 2001 From: deniz1a Date: Fri, 10 Jul 2015 23:00:04 +0300 Subject: [PATCH] Shows real owner of disguised units to allies. --- OpenRA.Mods.RA/Traits/Disguise.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/OpenRA.Mods.RA/Traits/Disguise.cs b/OpenRA.Mods.RA/Traits/Disguise.cs index 05290108b1..b7690b2d5b 100644 --- a/OpenRA.Mods.RA/Traits/Disguise.cs +++ b/OpenRA.Mods.RA/Traits/Disguise.cs @@ -49,10 +49,10 @@ namespace OpenRA.Mods.RA.Traits { get { - if (disguise.Disguised) - return self.Owner == self.World.LocalPlayer ? self.Owner : disguise.AsPlayer; + if (!disguise.Disguised || self.Owner.IsAlliedWith(self.World.RenderPlayer)) + return self.Owner; - return self.Owner; + return disguise.AsPlayer; } } } @@ -135,8 +135,8 @@ namespace OpenRA.Mods.RA.Traits if (target != null) { - // Take the image of the target's disguise, if it exist. - // E.g., SpyA is disguised as a dog. SpyB then targets SpyA. We should use the dog image. + // Take the image of the target's disguise, if it exists. + // E.g., SpyA is disguised as a rifle infantry. SpyB then targets SpyA. We should use the rifle infantry image. var targetDisguise = target.TraitOrDefault(); if (targetDisguise != null && targetDisguise.Disguised) {