From df4a860dfee0d7bae458edf62d8503271f8b648c Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Tue, 15 Feb 2011 22:17:25 +1300 Subject: [PATCH] Fix crash on surrender --- OpenRA.Mods.Cnc/SpawnViceroid.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenRA.Mods.Cnc/SpawnViceroid.cs b/OpenRA.Mods.Cnc/SpawnViceroid.cs index 66e77e656a..98baf9c790 100644 --- a/OpenRA.Mods.Cnc/SpawnViceroid.cs +++ b/OpenRA.Mods.Cnc/SpawnViceroid.cs @@ -36,7 +36,7 @@ namespace OpenRA.Mods.Cnc public void Damaged(Actor self, AttackInfo e) { - if (e.DamageState == DamageState.Dead && e.Warhead.InfDeath == Info.InfDeath + if (e.DamageState == DamageState.Dead && e.Warhead != null && e.Warhead.InfDeath == Info.InfDeath && self.World.SharedRandom.Next(100) <= Info.Probability) self.World.AddFrameEndTask(w => {