Make all warheads use WarheadArgs

Instead of passing damageModifiers directly.
This commit is contained in:
reaperrr
2020-05-01 00:54:58 +02:00
committed by Pavel Penev
parent 38cdc93010
commit 2b4035979b
5 changed files with 31 additions and 14 deletions

View File

@@ -11,6 +11,7 @@
using System.Collections.Generic;
using System.Linq;
using OpenRA.GameRules;
using OpenRA.Mods.Common.Traits;
using OpenRA.Primitives;
using OpenRA.Traits;
@@ -22,7 +23,7 @@ namespace OpenRA.Mods.Common.Warheads
[Desc("Damage will be applied to actors in this area. A value of zero means only targeted actor will be damaged.")]
public readonly WDist Spread = WDist.Zero;
public override void DoImpact(WPos pos, Actor firedBy, IEnumerable<int> damageModifiers)
public override void DoImpact(WPos pos, Actor firedBy, WarheadArgs args)
{
if (Spread == WDist.Zero)
return;
@@ -45,7 +46,7 @@ namespace OpenRA.Mods.Common.Warheads
if (closestActiveShape.First == null || closestActiveShape.Second > Spread)
continue;
InflictDamage(victim, firedBy, closestActiveShape.First.Info, damageModifiers);
InflictDamage(victim, firedBy, closestActiveShape.First, args);
}
}
}