From e4c3c7e5aff01ac9dfacc110d96121171e345b5c Mon Sep 17 00:00:00 2001 From: Matthew Bowra-Dean Date: Tue, 6 Oct 2009 18:19:33 +1300 Subject: [PATCH] Bug in building creation fixed. There was a scoping issue in the closure that was being used to create buildings in Game.cs --- OpenRa.Game/Game.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/OpenRa.Game/Game.cs b/OpenRa.Game/Game.cs index fb91c4947c..043be2a03f 100644 --- a/OpenRa.Game/Game.cs +++ b/OpenRa.Game/Game.cs @@ -52,7 +52,10 @@ namespace OpenRa.Game string[] buildings = { "fact", "powr", "apwr", "weap", "barr", "atek", "stek", "dome" }; foreach (string s in buildings) - buildingCreation.Add(s, (location, owner) => new Building(s, location, owner, this)); + { + var t = s; + buildingCreation.Add(t, (location, owner) => new Building(t, location, owner, this)); + } controller = new Controller(this); // CAREFUL THERES AN UGLY HIDDEN DEPENDENCY HERE STILL worldRenderer = new WorldRenderer(renderer, world);