Fix erroneous lua_pop parameter
authorkwolekr <kwolekr@minetest.net>
Thu, 30 Oct 2014 20:23:48 +0000 (16:23 -0400)
committerkwolekr <kwolekr@minetest.net>
Thu, 30 Oct 2014 20:23:48 +0000 (16:23 -0400)
src/script/lua_api/l_mapgen.cpp

index 75f5afa88a64b6f17a45318992898ba0fa1b672f..fdbeafb31c69db104242c2846603ecb58883af9b 100644 (file)
@@ -475,9 +475,11 @@ bool ModApiMapgen::regDecoSchematic(lua_State *L,
        lua_pop(L, 1);
 
        lua_getfield(L, index, "schematic");
-       if (!read_schematic(L, -1, deco, getServer(L)))
+       if (!read_schematic(L, -1, deco, getServer(L))) {
+               lua_pop(L, 1);
                return false;
-       lua_pop(L, -1);
+       }
+       lua_pop(L, 1);
 
        if (!deco->filename.empty() &&
                !deco->loadSchematicFile(resolver, replace_names)) {