Fix a crash when an infantry is crushed and killed by conventional means in the same tick.

This commit is contained in:
Paul Chote
2011-07-25 00:45:11 +12:00
parent 8ad3f47608
commit 49cbaeb1d2

View File

@@ -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);
}