mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-11 17:51:04 +00:00
LuaVoxelManip: Separate VoxelManip data get/set from emerging/blitting data back to map
This commit is contained in:
parent
2e292b67a0
commit
6b3169e4d0
4 changed files with 57 additions and 37 deletions
|
@ -594,22 +594,13 @@ int ModApiEnvMod::l_get_mapgen_object(lua_State *L)
|
|||
luaL_getmetatable(L, "VoxelManip");
|
||||
lua_setmetatable(L, -2);
|
||||
|
||||
// VoxelManip data
|
||||
int volume = vm->m_area.getVolume();
|
||||
lua_newtable(L);
|
||||
for (int i = 0; i != volume; i++) {
|
||||
lua_Number cid = vm->m_data[i].getContent();
|
||||
lua_pushnumber(L, cid);
|
||||
lua_rawseti(L, -2, i + 1);
|
||||
}
|
||||
|
||||
// emerged min pos
|
||||
push_v3s16(L, vm->m_area.MinEdge);
|
||||
|
||||
// emerged max pos
|
||||
push_v3s16(L, vm->m_area.MaxEdge);
|
||||
|
||||
nargs = 4;
|
||||
nargs = 3;
|
||||
|
||||
break; }
|
||||
case MGOBJ_HEIGHTMAP: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue