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.
This commit is contained in:
@@ -183,7 +183,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
w.Add(new FlashTarget(self));
|
w.Add(new FlashTarget(self));
|
||||||
|
|
||||||
foreach (var t in self.TraitsImplementing<INotifyCapture>())
|
foreach (var t in self.TraitsImplementing<INotifyCapture>())
|
||||||
t.OnCapture(self, captor, previousOwner, self.Owner);
|
t.OnCapture(self, captor, previousOwner, captor.Owner);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user