From 335b977cd4a102f21fa786c96a227bc81a71c319 Mon Sep 17 00:00:00 2001 From: GenericHeroGuy <86008856+GenericHeroGuy@users.noreply.github.com> Date: Sun, 10 Nov 2024 17:41:00 +0100 Subject: [PATCH] Fix API assert in LUA_EvalMath --- src/lua_script.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lua_script.c b/src/lua_script.c index 51696d599..c8f67594f 100644 --- a/src/lua_script.c +++ b/src/lua_script.c @@ -584,6 +584,9 @@ fixed_t LUA_EvalMath(const char *word) if (*p == '^') *b++ = '^'; } + // length of word is zero!? + if (p == word) + return 0; *b = '\0'; // eval string.