Remove DelayedAction from WeaponInfo and replace it with the more serialization friendly DelayedImpact

This commit is contained in:
Ori Bar
2016-11-04 01:36:45 +02:00
parent 8cda0dd360
commit fabe799907
3 changed files with 49 additions and 3 deletions

View File

@@ -159,11 +159,10 @@ namespace OpenRA.GameRules
{
var wh = warhead; // force the closure to bind to the current warhead
Action a = () => wh.DoImpact(target, firedBy, damageModifiers);
if (wh.Delay > 0)
firedBy.World.AddFrameEndTask(w => w.Add(new DelayedAction(wh.Delay, a)));
firedBy.World.AddFrameEndTask(w => w.Add(new DelayedImpact(wh.Delay, wh, target, firedBy, damageModifiers)));
else
a();
wh.DoImpact(target, firedBy, damageModifiers);
}
}
}