Merge pull request #10720 from GraionDilach/gen2-map-import-waypoint-fix

Do not crash during importing a TS map if a waypoint ID isn't an integer.
This commit is contained in:
Matthias Mailänder
2016-02-07 21:36:28 +01:00

View File

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