Do not crash during gen2 map importing if a waypoint ID isn't an integer.

This commit is contained in:
Zimmermann Gyula
2016-02-07 18:28:03 +01:00
parent f67e682041
commit 4aa9d26e12

View File

@@ -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"));