From 4aa9d26e12c13e66b6af0f277bc454655ad087fc Mon Sep 17 00:00:00 2001 From: Zimmermann Gyula Date: Sun, 7 Feb 2016 18:28:03 +0100 Subject: [PATCH] Do not crash during gen2 map importing if a waypoint ID isn't an integer. --- OpenRA.Mods.TS/UtilityCommands/ImportTSMapCommand.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.TS/UtilityCommands/ImportTSMapCommand.cs b/OpenRA.Mods.TS/UtilityCommands/ImportTSMapCommand.cs index 06cff2d28e..6d5699341c 100644 --- a/OpenRA.Mods.TS/UtilityCommands/ImportTSMapCommand.cs +++ b/OpenRA.Mods.TS/UtilityCommands/ImportTSMapCommand.cs @@ -347,7 +347,8 @@ namespace OpenRA.Mods.TS.UtilityCommands var dy = rx + ry - fullSize.X - 1; var cell = new MPos(dx / 2, dy).ToCPos(map); - var ar = new ActorReference(int.Parse(kv.Key) <= 7 ? "mpspawn" : "waypoint"); + int wpindex; + var ar = new ActorReference((!int.TryParse(kv.Key, out wpindex) || wpindex > 7) ? "waypoint" : "mpspawn"); ar.Add(new LocationInit(cell)); ar.Add(new OwnerInit("Neutral"));