diff --git a/src/lua_script.c b/src/lua_script.c index 29ee094d9eb97f01925386ce53b9db133ba06878..c0e31557ec36e38d97c12ce89112f65d0c44d5cb 100644 --- a/src/lua_script.c +++ b/src/lua_script.c @@ -399,6 +399,21 @@ int LUA_CheckGlobals(lua_State *L, const char *word) if (player) displayplayer = player - players; } + else if (fastcmp(word, "mapmusname")) + { + size_t strlength; + const char *str = luaL_checkstring(L, 2, &strlength); + + if (strlength > 6) + return luaL_error(L, "string length out of range (maximum 6 characters)"); + + if (strlen(str) < strlength) + return luaL_error(L, "string must not contain embedded zeros!"); + + strncpy(mapmusname, str, strlength); + } + else if (fastcmp(word, "mapmusflags")) + mapmusflags = (UINT16)luaL_checkinteger(L, 2); else return 0;