fix a rare crash in cnc docking
This commit is contained in:
@@ -157,6 +157,8 @@ namespace OpenRA.Traits
|
|||||||
|
|
||||||
public static DamageState GetDamageState(this Actor self)
|
public static DamageState GetDamageState(this Actor self)
|
||||||
{
|
{
|
||||||
|
if (self.Destroyed) return DamageState.Dead;
|
||||||
|
|
||||||
var health = self.TraitOrDefault<Health>();
|
var health = self.TraitOrDefault<Health>();
|
||||||
return (health == null) ? DamageState.Undamaged : health.DamageState;
|
return (health == null) ? DamageState.Undamaged : health.DamageState;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user