Skip to content

Commit

Permalink
fix lua mapgen map special_locations
Browse files Browse the repository at this point in the history
  • Loading branch information
gfgtdf committed Dec 9, 2018
1 parent 830b2fd commit 75a71b8
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/scripting/lua_terrainmap.cpp
Expand Up @@ -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)
Expand Down

0 comments on commit 75a71b8

Please sign in to comment.