Introduce WarheadArgs
- Passes additional arguments to warheads on impact - Uses that to reduce parameter count of DoImpact by 1
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.GameRules;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Mods.Common.Graphics;
|
||||
@@ -231,7 +232,13 @@ namespace OpenRA.Mods.Common.Projectiles
|
||||
foreach (var a in actors)
|
||||
{
|
||||
var adjustedModifiers = args.DamageModifiers.Append(GetFalloff((args.Source - a.CenterPosition).Length));
|
||||
args.Weapon.Impact(Target.FromActor(a), args.SourceActor, adjustedModifiers);
|
||||
|
||||
var warheadArgs = new WarheadArgs(args)
|
||||
{
|
||||
DamageModifiers = adjustedModifiers.ToArray(),
|
||||
};
|
||||
|
||||
args.Weapon.Impact(Target.FromActor(a), warheadArgs);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user