From 49cbaeb1d22623b5be523cf842c08c06366095aa Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Mon, 25 Jul 2011 00:45:11 +1200 Subject: [PATCH] Fix a crash when an infantry is crushed and killed by conventional means in the same tick. --- OpenRA.Mods.RA/CrushableInfantry.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.RA/CrushableInfantry.cs b/OpenRA.Mods.RA/CrushableInfantry.cs index 5a0b1b08c1..11109fdcf5 100644 --- a/OpenRA.Mods.RA/CrushableInfantry.cs +++ b/OpenRA.Mods.RA/CrushableInfantry.cs @@ -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); }