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:
@@ -52,7 +52,10 @@ namespace OpenRa.Game
|
|||||||
|
|
||||||
string[] buildings = { "fact", "powr", "apwr", "weap", "barr", "atek", "stek", "dome" };
|
string[] buildings = { "fact", "powr", "apwr", "weap", "barr", "atek", "stek", "dome" };
|
||||||
foreach (string s in buildings)
|
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
|
controller = new Controller(this); // CAREFUL THERES AN UGLY HIDDEN DEPENDENCY HERE STILL
|
||||||
worldRenderer = new WorldRenderer(renderer, world);
|
worldRenderer = new WorldRenderer(renderer, world);
|
||||||
|
|||||||
Reference in New Issue
Block a user