summaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_vmanip.cpp
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2013-06-26 17:19:39 -0400
committerkwolekr <kwolekr@minetest.net>2013-06-27 22:35:35 -0400
commit8aa930f28e69f3518831500022988ca2a4b6985d (patch)
tree5699c9b0cd8eaa54f4fadf8dcd7d0ba98a9c3c74 /src/script/lua_api/l_vmanip.cpp
parent2c0b51795e6fa6747d881f1871c89830abb6e6e8 (diff)
downloadminetest-8aa930f28e69f3518831500022988ca2a4b6985d.tar.gz
minetest-8aa930f28e69f3518831500022988ca2a4b6985d.tar.bz2
minetest-8aa930f28e69f3518831500022988ca2a4b6985d.zip
Add minetest.get_mapgen_object to API
Diffstat (limited to 'src/script/lua_api/l_vmanip.cpp')
-rw-r--r--src/script/lua_api/l_vmanip.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/script/lua_api/l_vmanip.cpp b/src/script/lua_api/l_vmanip.cpp
index e0397dfce..6743f40f9 100644
--- a/src/script/lua_api/l_vmanip.cpp
+++ b/src/script/lua_api/l_vmanip.cpp
@@ -33,7 +33,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
int LuaVoxelManip::gc_object(lua_State *L)
{
LuaVoxelManip *o = *(LuaVoxelManip **)(lua_touserdata(L, 1));
- delete o;
+ if (o->do_gc)
+ delete o;
return 0;
}
@@ -82,7 +83,6 @@ int LuaVoxelManip::l_write_chunk(lua_State *L)
vm->m_data[i].setContent(c);
lua_pop(L, 1);
-
}
vm->blitBackAll(&o->modified_blocks);
@@ -184,6 +184,12 @@ int LuaVoxelManip::l_update_map(lua_State *L)
return 0;
}
+LuaVoxelManip::LuaVoxelManip(ManualMapVoxelManipulator *mmvm, bool dogc)
+{
+ this->vm = mmvm;
+ this->do_gc = dogc;
+}
+
LuaVoxelManip::LuaVoxelManip(Map *map)
{
vm = new ManualMapVoxelManipulator(map);