mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 16:45:20 +02:00
Add minetest.get_mapgen_object to API
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user