Skip to content
Snippets Groups Projects
Commit c70d5a97 authored by Golden's avatar Golden
Browse files

Make `mapmusflags` and `mapmusname` writable.

parent 365e02bb
No related branches found
No related tags found
1 merge request!1233Make several Lua global variables writable.
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment