fix stack overflow in Map.Resize()

This commit is contained in:
Chris Forbes
2011-02-15 15:46:16 +13:00
parent 786eafd7fa
commit 2b85c7e0b9

View File

@@ -417,9 +417,12 @@ namespace OpenRA
}
public void Resize(int width, int height) // editor magic.
{
MapTiles = Lazy.New(() => ResizeArray(MapTiles.Value, MapTiles.Value[0, 0], width, height));
MapResources = Lazy.New(() => ResizeArray(MapResources.Value, MapResources.Value[0, 0], width, height));
{
var oldMapTiles = MapTiles.Value;
var oldMapResources = MapResources.Value;
MapTiles = Lazy.New(() => ResizeArray(oldMapTiles, oldMapTiles[0, 0], width, height));
MapResources = Lazy.New(() => ResizeArray(oldMapResources, oldMapResources[0, 0], width, height));
MapSize = new int2(width, height);
}