Introduce WarheadArgs
- Passes additional arguments to warheads on impact - Uses that to reduce parameter count of DoImpact by 1
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#endregion
|
||||
|
||||
using System.Collections.Generic;
|
||||
using OpenRA.GameRules;
|
||||
using OpenRA.Mods.Common.Warheads;
|
||||
using OpenRA.Mods.D2k.Traits;
|
||||
using OpenRA.Traits;
|
||||
@@ -23,11 +24,12 @@ namespace OpenRA.Mods.D2k.Warheads
|
||||
[FieldLoader.Require]
|
||||
public readonly int Damage = 0;
|
||||
|
||||
public override void DoImpact(Target target, Actor firedBy, IEnumerable<int> damageModifiers)
|
||||
public override void DoImpact(Target target, WarheadArgs args)
|
||||
{
|
||||
if (target.Type == TargetType.Invalid)
|
||||
return;
|
||||
|
||||
var firedBy = args.SourceActor;
|
||||
var world = firedBy.World;
|
||||
var layer = world.WorldActor.Trait<BuildableTerrainLayer>();
|
||||
var cell = world.Map.CellContaining(target.CenterPosition);
|
||||
|
||||
Reference in New Issue
Block a user