From e6dcf3dee61cc94e91fdf7b5e1d33e896ee1940b Mon Sep 17 00:00:00 2001 From: Oliver Brakmann Date: Sun, 29 May 2016 20:33:34 +0200 Subject: [PATCH] Fix calling OnOwnerChange with wrong player in ProximityCapturable The actor's owner only gets changed in an end frame task queued by `Actor.ChangeOwner`. So during this frame end task, `self.Owner` still points to the old owner, whereas we want the new one, represented by `captor.Owner`. This bug lead to the capture notification being played when *losing* a building, but not when actually capturing it. --- OpenRA.Mods.Common/Traits/ProximityCapturable.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/Traits/ProximityCapturable.cs b/OpenRA.Mods.Common/Traits/ProximityCapturable.cs index 9a10ead140..4af4e8eb6f 100644 --- a/OpenRA.Mods.Common/Traits/ProximityCapturable.cs +++ b/OpenRA.Mods.Common/Traits/ProximityCapturable.cs @@ -183,7 +183,7 @@ namespace OpenRA.Mods.Common.Traits w.Add(new FlashTarget(self)); foreach (var t in self.TraitsImplementing()) - t.OnCapture(self, captor, previousOwner, self.Owner); + t.OnCapture(self, captor, previousOwner, captor.Owner); }); }