diff --git a/OpenRA.Game/GameRules/WeaponInfo.cs b/OpenRA.Game/GameRules/WeaponInfo.cs index c675ace60b..49d3de4446 100644 --- a/OpenRA.Game/GameRules/WeaponInfo.cs +++ b/OpenRA.Game/GameRules/WeaponInfo.cs @@ -62,6 +62,7 @@ namespace OpenRA.GameRules [FieldLoader.LoadUsing("LoadProjectile")] public readonly IProjectileInfo Projectile; + [FieldLoader.LoadUsing("LoadWarheads")] public readonly List Warheads = new List(); @@ -93,7 +94,7 @@ namespace OpenRA.GameRules return retList; } - ///Checks if the weapon is valid against (can target) the target. + /// Checks if the weapon is valid against (can target) the target. public bool IsValidAgainst(Target target, World world, Actor firedBy) { if (target.Type == TargetType.Actor) @@ -119,7 +120,7 @@ namespace OpenRA.GameRules return false; } - ///Checks if the weapon is valid against (can target) the actor. + /// Checks if the weapon is valid against (can target) the actor. public bool IsValidAgainst(Actor victim, Actor firedBy) { var targetable = victim.TraitOrDefault(); @@ -133,7 +134,7 @@ namespace OpenRA.GameRules return true; } - ///Checks if the weapon is valid against (can target) the frozen actor. + /// Checks if the weapon is valid against (can target) the frozen actor. public bool IsValidAgainst(FrozenActor victim, Actor firedBy) { var targetable = victim.Info.Traits.GetOrDefault(); @@ -147,18 +148,16 @@ namespace OpenRA.GameRules return true; } - ///Applies all the weapon's warheads to the target. + /// Applies all the weapon's warheads to the target. public void Impact(Target target, Actor firedBy, IEnumerable damageModifiers) { foreach (var warhead in Warheads) { var wh = warhead; // force the closure to bind to the current warhead - Action a; - a = () => wh.DoImpact(target, firedBy, damageModifiers); + 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 DelayedAction(wh.Delay, a))); else a(); }