Fix LUA_EvalMath warnings being broken sometimes

This commit is contained in:
indev committed 2024-08-11 12:03:54 +03:00
1 parent 37da18cdcb
commit 521c9f686f
1 file changed
+8 -2
+8 -2
View File
@@ -402,8 +402,14 @@ fixed_t LUA_EvalMathEx(const char *word, const char **error)
if (luaL_dostring(mL, buf))
{
p = lua_tostring(mL, -1);
while (*p++ != ':' && *p) ;
p += 3; // "1: "
// If there is [string "..."]:1: text, skip it
if (strstr(p, ":") != NULL)
{
while (*p++ != ':' && *p);
p += 3; // "1: "
}
if (error) *error = p;
}
else