Fix traits implementing INotifyKilled

This commit is contained in:
penev92
2015-07-04 16:15:56 +03:00
parent 351cf254e7
commit 41cdc57ea5
4 changed files with 18 additions and 7 deletions

View File

@@ -9,6 +9,7 @@
#endregion
using System.Linq;
using OpenRA.Mods.Common.Warheads;
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
@@ -40,7 +41,8 @@ namespace OpenRA.Mods.Common.Traits
if (self.World.SharedRandom.Next(100) > info.Chance)
return;
if (info.DeathType != null && e.Warhead != null && !info.DeathType.Intersect(e.Warhead.DamageTypes).Any())
var warhead = e.Warhead as DamageWarhead;
if (info.DeathType != null && warhead != null && !info.DeathType.Intersect(warhead.DamageTypes).Any())
return;
var weaponName = ChooseWeaponForExplosion(self);