add a sensible error when trying to save a map using a bogus tileset
This commit is contained in:
@@ -377,6 +377,11 @@ namespace OpenRA
|
|||||||
writer.Write((ushort)MapSize.X);
|
writer.Write((ushort)MapSize.X);
|
||||||
writer.Write((ushort)MapSize.Y);
|
writer.Write((ushort)MapSize.Y);
|
||||||
|
|
||||||
|
if (!OpenRA.Rules.TileSets.ContainsKey(Tileset))
|
||||||
|
throw new InvalidOperationException(
|
||||||
|
"Tileset used by the map ({0}) does not exist in this mod. Valid tilesets are: {1}"
|
||||||
|
.F(Tileset, string.Join(",", OpenRA.Rules.TileSets.Keys.ToArray())));
|
||||||
|
|
||||||
// Tile data
|
// Tile data
|
||||||
for (int i = 0; i < MapSize.X; i++)
|
for (int i = 0; i < MapSize.X; i++)
|
||||||
for (int j = 0; j < MapSize.Y; j++)
|
for (int j = 0; j < MapSize.Y; j++)
|
||||||
|
|||||||
Reference in New Issue
Block a user