Isolate gameplay map state from the map cache. Fixes #4937.

This commit is contained in:
Paul Chote
2014-03-22 13:03:45 +13:00
parent 3f2ca8d9d3
commit 37101ba88e

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