Throw with a less generic KeyNotFoundException on error.
This commit is contained in:
@@ -62,6 +62,9 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
|||||||
|
|
||||||
// The original game isn't case sensitive, but we are.
|
// The original game isn't case sensitive, but we are.
|
||||||
var tileset = GetTileset(mapSection).ToUpperInvariant();
|
var tileset = GetTileset(mapSection).ToUpperInvariant();
|
||||||
|
if (!modData.DefaultTileSets.ContainsKey(tileset))
|
||||||
|
throw new InvalidDataException("Unknown tileset {0}".F(tileset));
|
||||||
|
|
||||||
Map = new Map(modData, modData.DefaultTileSets[tileset], MapSize, MapSize)
|
Map = new Map(modData, modData.DefaultTileSets[tileset], MapSize, MapSize)
|
||||||
{
|
{
|
||||||
Title = basic.GetValue("Name", Path.GetFileNameWithoutExtension(filename)),
|
Title = basic.GetValue("Name", Path.GetFileNameWithoutExtension(filename)),
|
||||||
|
|||||||
Reference in New Issue
Block a user