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.Primitives;
using OpenRA.Traits;
@@ -33,9 +34,12 @@ namespace OpenRA.Mods.Cnc.Traits
public void Killed(Actor self, AttackInfo e)
{
if (!self.World.LobbyInfo.GlobalSettings.Creeps) return;
if (e.Warhead == null || !e.Warhead.DamageTypes.Contains(info.DeathType)) return;
if (self.World.SharedRandom.Next(100) > info.Probability) return;
var warhead = e.Warhead as DamageWarhead;
if (warhead == null || !warhead.DamageTypes.Contains(info.DeathType))
return;
self.World.AddFrameEndTask(w =>
{
var td = new TypeDictionary