mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-02-17 01:22:18 +00:00
DeHackEd: fixed a problem where patches with things without names resulted in an parsing error
This commit is contained in:
parent
a86fce577e
commit
e0313a18bb
1 changed files with 2 additions and 2 deletions
|
@ -389,7 +389,7 @@ namespace CodeImp.DoomBuilder.Dehacked
|
|||
{
|
||||
// Thing headers have the format "Thing <thingnumber> (<thingname>)". Note that "thingnumber" is not the
|
||||
// DoomEdNum, but the Dehacked thing number
|
||||
Regex re = new Regex(@"thing\s+(\d+)\s+\((.+)\)", RegexOptions.IgnoreCase);
|
||||
Regex re = new Regex(@"thing\s+(\d+)(\s+\((.+)\))?", RegexOptions.IgnoreCase);
|
||||
Match m = re.Match(line);
|
||||
|
||||
if (!m.Success)
|
||||
|
@ -399,7 +399,7 @@ namespace CodeImp.DoomBuilder.Dehacked
|
|||
}
|
||||
|
||||
int dehthingnumber = int.Parse(m.Groups[1].Value);
|
||||
string dehthingname = m.Groups[2].Value;
|
||||
string dehthingname = string.IsNullOrWhiteSpace(m.Groups[3].Value) ? "<DeHackEd thing " + dehthingnumber + ">" : m.Groups[3].Value;
|
||||
string fieldkey = string.Empty;
|
||||
string fieldvalue = string.Empty;
|
||||
|
||||
|
|
Loading…
Reference in a new issue