fix #2528 - crashy race in DemoTruck destruction

This commit is contained in:
Chris Forbes
2013-04-02 19:39:15 +13:00
parent f556be975c
commit c62a7572a7

View File

@@ -160,6 +160,7 @@ namespace OpenRA.Traits
public static void InflictDamage(this Actor self, Actor attacker, int damage, WarheadInfo warhead)
{
if (self.Destroyed) return;
var health = self.TraitOrDefault<Health>();
if (health == null) return;
health.InflictDamage(self, attacker, damage, warhead, false);