Fixed: Crash when selling iron curtained' buildings

This commit is contained in:
geckosoft
2010-11-22 17:20:00 +01:00
committed by Paul Chote
parent be701007df
commit 7b7bcf1005

View File

@@ -27,12 +27,15 @@ namespace OpenRA.Mods.RA.Effects
public void Tick( World world )
{
if (a.IsDead() || b.GetDamageModifier(null, null) > 0)
if (a.Destroyed || a.IsDead() || b.GetDamageModifier(null, null) > 0)
world.AddFrameEndTask(w => w.Remove(this));
}
public IEnumerable<Renderable> Render()
{
if (a.Destroyed) // Tick will clean up
yield break;
foreach (var r in a.Render())
yield return r.WithPalette("invuln");
}