Bug in building creation fixed.

There was a scoping issue in the closure that was being used to create buildings in Game.cs
This commit is contained in:
Matthew Bowra-Dean
2009-10-06 18:19:33 +13:00
parent 7d47f6f9f5
commit e4c3c7e5af

View File

@@ -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);