Fix trait order issues with KillsSelf

This commit is contained in:
reaperrr
2019-12-31 16:18:15 +01:00
committed by Paul Chote
parent 16c2062d9d
commit 308c64c7b1

View File

@@ -48,7 +48,7 @@ namespace OpenRA.Mods.Common.Traits
// Actors can be created without being added to the world
// We want to make sure that this only triggers once they are inserted into the world
if (lifetime == 0 && self.IsInWorld)
Kill(self);
self.World.AddFrameEndTask(w => Kill(self));
}
protected override void Created(Actor self)
@@ -72,7 +72,7 @@ namespace OpenRA.Mods.Common.Traits
return;
if (lifetime-- <= 0)
Kill(self);
self.World.AddFrameEndTask(w => Kill(self));
}
void Kill(Actor self)