fix #2126 - crash on spawning a corpse for an actor which has already been destroyed

This commit is contained in:
Chris Forbes
2012-06-21 09:50:02 +12:00
parent 5c4e49cc3f
commit 2cdd1f7376

View File

@@ -124,7 +124,11 @@ namespace OpenRA.Mods.RA.Render
return;
Sound.PlayVoice("Die", self, self.Owner.Country.Race);
self.World.AddFrameEndTask(w => w.Add(new Corpse(self, "die{0}".F(e.Warhead.InfDeath + 1))));
self.World.AddFrameEndTask(w =>
{
if (!self.Destroyed)
w.Add(new Corpse(self, "die{0}".F(e.Warhead.InfDeath + 1)));
});
}
}
}