From aeacc8602853445eab2f078ca26d39e7b86d41ab Mon Sep 17 00:00:00 2001 From: abcdefg30 Date: Fri, 7 Feb 2020 14:38:25 +0100 Subject: [PATCH] Remove a loop closure guard variable --- OpenRA.Game/GameRules/WeaponInfo.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/OpenRA.Game/GameRules/WeaponInfo.cs b/OpenRA.Game/GameRules/WeaponInfo.cs index 31aa4d975c..98497ae9ae 100644 --- a/OpenRA.Game/GameRules/WeaponInfo.cs +++ b/OpenRA.Game/GameRules/WeaponInfo.cs @@ -203,12 +203,10 @@ namespace OpenRA.GameRules var world = args.SourceActor.World; foreach (var warhead in Warheads) { - var wh = warhead; // force the closure to bind to the current warhead - - if (wh.Delay > 0) - world.AddFrameEndTask(w => w.Add(new DelayedImpact(wh.Delay, wh, target, args))); + if (warhead.Delay > 0) + world.AddFrameEndTask(w => w.Add(new DelayedImpact(warhead.Delay, warhead, target, args))); else - wh.DoImpact(target, args); + warhead.DoImpact(target, args); } }