fix a rare crash in cnc docking

This commit is contained in:
Chris Forbes
2011-03-06 11:31:54 +13:00
parent d4f58015c7
commit 020c2a8a4a

View File

@@ -157,6 +157,8 @@ namespace OpenRA.Traits
public static DamageState GetDamageState(this Actor self)
{
if (self.Destroyed) return DamageState.Dead;
var health = self.TraitOrDefault<Health>();
return (health == null) ? DamageState.Undamaged : health.DamageState;
}