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

@@ -251,9 +251,13 @@ namespace OpenRA
static string ChooseShellmap()
{
return modData.AvailableMaps
.Where(m => m.Value.UseAsShellmap)
.Random(CosmeticRandom).Key;
var shellmaps = modData.AvailableMaps
.Where(m => m.Value.UseAsShellmap);
if (shellmaps.Count() == 0)
throw new InvalidDataException("No valid shellmaps available");
return shellmaps.Random(CosmeticRandom).Key;
}
static bool quit;