Fix a loop closure bug in the weapons code.

Fixes #6597. Fixes #6599.
This commit is contained in:
Paul Chote
2014-09-29 20:57:20 +13:00
parent 20a41d8803
commit f463407d8d

View File

@@ -150,8 +150,9 @@ namespace OpenRA.GameRules
///<summary>Applies all the weapon's warheads to the target.</summary> ///<summary>Applies all the weapon's warheads to the target.</summary>
public void Impact(Target target, Actor firedBy, IEnumerable<int> damageModifiers) public void Impact(Target target, Actor firedBy, IEnumerable<int> damageModifiers)
{ {
foreach (var wh in Warheads) foreach (var warhead in Warheads)
{ {
var wh = warhead; // force the closure to bind to the current warhead
Action a; Action a;
a = () => wh.DoImpact(target, firedBy, damageModifiers); a = () => wh.DoImpact(target, firedBy, damageModifiers);