From 521c9f686fbe5882a5edd0ffc4bf045a50040d80 Mon Sep 17 00:00:00 2001 From: Indev Date: Sun, 11 Aug 2024 11:57:54 +0300 Subject: [PATCH] Fix LUA_EvalMath warnings being broken sometimes --- src/lua_script.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/lua_script.c b/src/lua_script.c index 6db95a08b..ca78a6377 100644 --- a/src/lua_script.c +++ b/src/lua_script.c @@ -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