diff --git a/src/lua_maplib.c b/src/lua_maplib.c index 2ae2ce395..d92cd1f8b 100644 --- a/src/lua_maplib.c +++ b/src/lua_maplib.c @@ -1647,6 +1647,7 @@ static int mapheaderinfo_get(lua_State *L) break; // TODO add support for reading numGradedMares and grades default: + { // Read custom vars now // (note: don't include the "LUA." in your lua scripts!) UINT8 j = 0; @@ -1657,6 +1658,7 @@ static int mapheaderinfo_get(lua_State *L) else lua_pushnil(L); } + } return 1; } @@ -1832,4 +1834,4 @@ int LUA_MapLib(lua_State *L) lua_setmetatable(L, -2); lua_setglobal(L, "mapheaderinfo"); return 0; -} \ No newline at end of file +} diff --git a/src/lua_mobjlib.c b/src/lua_mobjlib.c index 866ea6550..f62e59486 100644 --- a/src/lua_mobjlib.c +++ b/src/lua_mobjlib.c @@ -886,11 +886,13 @@ static int mapthing_set(lua_State *L) mt->z = (INT16)luaL_checkinteger(L, 3); break; case mapthing_extrainfo: + { INT32 extrainfo = luaL_checkinteger(L, 3); if (extrainfo & ~15) return luaL_error(L, "mapthing_t extrainfo set %d out of range (%d - %d)", extrainfo, 0, 15); mt->extrainfo = (UINT8)extrainfo; break; + } case mapthing_mobj: mt->mobj = *((mobj_t **)luaL_checkudata(L, 3, META_MOBJ)); break; @@ -979,4 +981,4 @@ int LUA_MobjLib(lua_State *L) lua_setmetatable(L, -2); lua_setglobal(L, "mapthings"); return 0; -} \ No newline at end of file +}