Merge pull request #4938 from pchote/map-derp

Isolate gameplay map state from the map cache.
This commit is contained in:
Curtis Shmyr
2014-03-21 18:33:54 -06:00

View File

@@ -103,10 +103,12 @@ namespace OpenRA
{
LoadScreen.Display();
var map = MapCache[uid].Map;
if (map == null)
if (MapCache[uid].Status != MapStatus.Available)
throw new InvalidDataException("Invalid map uid: {0}".F(uid));
// Operate on a copy of the map to avoid gameplay state leaking into the cache
var map = new Map(MapCache[uid].Map.Path);
LoadTranslations(map);
// Reinit all our assets