Merge pull request #2929 from chrisforbes/bug-2528

fix #2528 - crashy race in DemoTruck destruction
This commit is contained in:
Matthias Mailänder
2013-04-02 00:09:02 -07:00

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);