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:
@@ -346,7 +346,8 @@ namespace OpenRA.Mods.TS.UtilityCommands
|
|||||||
var dy = rx + ry - fullSize.X - 1;
|
var dy = rx + ry - fullSize.X - 1;
|
||||||
var cell = new MPos(dx / 2, dy).ToCPos(map);
|
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 LocationInit(cell));
|
||||||
ar.Add(new OwnerInit("Neutral"));
|
ar.Add(new OwnerInit("Neutral"));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user