Fix a crash when an infantry is crushed and killed by conventional means in the same tick.
This commit is contained in:
@@ -45,7 +45,12 @@ namespace OpenRA.Mods.RA
|
||||
public void OnCrush(Actor crusher)
|
||||
{
|
||||
Sound.Play(Info.CrushSound);
|
||||
self.World.AddFrameEndTask(w => w.Add(new Corpse(self, Info.CorpseSequence)));
|
||||
self.World.AddFrameEndTask(w =>
|
||||
{
|
||||
if (!self.Destroyed)
|
||||
w.Add(new Corpse(self, Info.CorpseSequence));
|
||||
});
|
||||
|
||||
self.Kill(crusher);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user