Fix UpgradeActorsNear revoking upgrades after the actor dies

Very hard bug to reproduce: if you can power down a stealth generator just as it is dieing you can hit a race condition that leads to ActorExited() being called to revoke the upgrades after they have already been revoked once.
This commit is contained in:
Pavel Penev
2015-11-15 18:48:54 +02:00
parent 0c1283c8c0
commit 13978b08bc

View File

@@ -88,7 +88,7 @@ namespace OpenRA.Mods.Common.Traits
void ActorEntered(Actor a)
{
if (a.Disposed)
if (a.Disposed || self.Disposed)
return;
if (a == self && !info.AffectsParent)
@@ -123,7 +123,7 @@ namespace OpenRA.Mods.Common.Traits
void ActorExited(Actor a)
{
if (a == self || a.Disposed)
if (a == self || a.Disposed || self.Disposed)
return;
var stance = self.Owner.Stances[a.Owner];