mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-02-16 17:11:28 +00:00
Fix non-number mapthingnums (i.e. "none") causing a crash
This commit is contained in:
parent
bd9b6ae5a8
commit
889bfc4784
2 changed files with 6 additions and 5 deletions
|
@ -108,7 +108,10 @@ namespace CodeImp.DoomBuilder.ZDoom
|
|||
props["yscale"] = values;
|
||||
break;
|
||||
case "doomednum":
|
||||
doomednum = (editnum > 0) ? editnum : int.Parse(values[0]);
|
||||
if (editnum > 0)
|
||||
doomednum = editnum;
|
||||
else if (!int.TryParse(values[0], out doomednum))
|
||||
doomednum = 0;
|
||||
goto default;
|
||||
case "height":
|
||||
case "radius":
|
||||
|
|
|
@ -73,9 +73,6 @@ namespace CodeImp.DoomBuilder.ZDoom
|
|||
parser.SkipWhitespace(false, true);
|
||||
token = parser.ReadToken();
|
||||
|
||||
//General.WriteLogLine("token name = " + tokenname);
|
||||
//General.WriteLogLine("token = " + token);
|
||||
|
||||
if (token != "=")
|
||||
{
|
||||
parser.ReportError("Invalid SOC object parameter definition, missing =");
|
||||
|
@ -103,7 +100,8 @@ namespace CodeImp.DoomBuilder.ZDoom
|
|||
break;
|
||||
case "doomednum":
|
||||
case "mapthingnum":
|
||||
doomednum = int.Parse(values[0]);
|
||||
if (!int.TryParse(values[0], out doomednum))
|
||||
doomednum = 0;
|
||||
goto default;
|
||||
case "height":
|
||||
case "radius":
|
||||
|
|
Loading…
Reference in a new issue