mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-26 05:41:45 +00:00
DeHackEd: fixed and issue where the "#" in "ID #" fields was erroneously interpreted as a comment. Fixes #735
This commit is contained in:
parent
d08bc4438b
commit
df29245a59
1 changed files with 12 additions and 2 deletions
|
@ -195,9 +195,19 @@ namespace CodeImp.DoomBuilder.Dehacked
|
|||
linenumber++;
|
||||
string line = datareader.ReadLine();
|
||||
|
||||
// Cut everything from the line after a #, unless it's a editor key (#$)
|
||||
if (line != null)
|
||||
return Regex.Replace(line, @"(#[^$].+)", "", RegexOptions.IgnoreCase).Trim();
|
||||
{
|
||||
line = line.Trim();
|
||||
|
||||
// Editor key?
|
||||
if (line.StartsWith("$#"))
|
||||
return line;
|
||||
|
||||
// Cut everything from the line after a #, unless it's the "ID #" field, then cut everything after then next #
|
||||
// This is technically against the (nowhere officially defined) DeHackEd specs, but of course people manually
|
||||
// added comments at the end of lines anyway and got away with it
|
||||
return Regex.Replace(line, @"\s*(id\s+#)?([^#]*)(#[^$].+)?", "$1$2", RegexOptions.IgnoreCase).Trim();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue