Bugfixes: ZipFile.GetInputStream().GetAllBytes/.Length doesn't work; Divide by zero when no shellmaps are available; UseAsShellmap isn't saved by the editor; Duplicate maps crashes game.

This commit is contained in:
Paul Chote
2010-12-30 16:39:26 +13:00
parent 47bbc3a6de
commit cb50182fac
4 changed files with 28 additions and 7 deletions

View File

@@ -62,8 +62,16 @@ namespace OpenRA
{
var paths = mods.SelectMany(p => FindMapsIn("mods/" + p + "/maps/"));
return paths.Select(p => new MapStub(p))
.ToDictionary(m => m.Uid);
Dictionary<string, MapStub> ret = new Dictionary<string, MapStub>();
foreach (var path in paths)
{
var map = new MapStub(path);
if (ret.ContainsKey(map.Uid))
System.Console.WriteLine("Ignoring duplicate map: {0}", path);
else
ret.Add(map.Uid, map);
}
return ret;
}
string cachedTileset = null;