Recognize -- comments in Lua files.

Only log a warning when a Thing sprite can't be found, instead of aborting the whole Lua/SOC reader.
This commit is contained in:
MascaraSnake 2017-07-06 16:57:53 +02:00
parent 58b0ec16e1
commit e7306d016d
2 changed files with 4 additions and 4 deletions

View file

@ -133,7 +133,7 @@ namespace CodeImp.DoomBuilder.SRB2
sprite = token;
break;
}
ReportError("The sprite \"" + token + "\" assigned by the \"$sprite\" property does not exist");
LogWarning("The sprite \"" + token + "\" assigned by the \"$sprite\" property does not exist");
return false;
case "doomednum":
if (!ReadParameter(out token, out finished)) return false;
@ -258,11 +258,11 @@ namespace CodeImp.DoomBuilder.SRB2
c = (char)datareader.ReadByte();
// Check if this is comment
if (c == '/')
if (c == '/' || c == '-')
{
if (datastream.Position == datastream.Length) return false;
char c2 = (char)datareader.ReadByte();
if (c2 == '/')
if (c2 == c)
{
// Check if not a special comment with a token
if (datastream.Position == datastream.Length) return false;

View file

@ -159,7 +159,7 @@ namespace CodeImp.DoomBuilder.SRB2
sprite = spritename;
continue;
}
ReportError("The sprite \"" + spritename + "\" assigned by the \"$sprite\" property does not exist");
LogWarning("The sprite \"" + spritename + "\" assigned by the \"$sprite\" property does not exist");
}
if (line.StartsWith("#$Name "))
{