1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-11 17:51:04 +00:00

Add minetest.get_mapgen_object to API

This commit is contained in:
kwolekr 2013-06-26 17:19:39 -04:00
parent 2c0b51795e
commit 8aa930f28e
14 changed files with 188 additions and 9 deletions

View file

@ -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);