fix lua mapgen map special_locations

This commit is contained in:
gfgtdf 2018-12-03 02:57:51 +01:00
parent 830b2fdc3d
commit 75a71b8dc8

View file

@ -44,13 +44,14 @@ bool luaW_isslocs(lua_State* L, int index)
mapgen_gamemap* luaW_toslocs(lua_State *L, int index)
{
if(luaW_isterrainmap(L, index)) {
lua_rawgeti(L, index, 1);
mapgen_gamemap* m = luaW_toterrainmap(L, -1);
lua_pop(L, 1);
return m;
if(!lua_istable(L, index)) {
return nullptr;
}
return nullptr;
lua_rawgeti(L, index, 1);
mapgen_gamemap* m = luaW_toterrainmap(L, -1);
lua_pop(L, 1);
return m;
}
mapgen_gamemap& luaW_check_slocs(lua_State *L, int index)