mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Lua voxelmanip: Add optional buffer param for 'get param2 data'
Update lua_api.txt.
This commit is contained in:
parent
380a4b6d60
commit
70e2df4f86
2 changed files with 10 additions and 2 deletions
|
@ -277,11 +277,17 @@ int LuaVoxelManip::l_get_param2_data(lua_State *L)
|
|||
NO_MAP_LOCK_REQUIRED;
|
||||
|
||||
LuaVoxelManip *o = checkobject(L, 1);
|
||||
bool use_buffer = lua_istable(L, 2);
|
||||
|
||||
MMVManip *vm = o->vm;
|
||||
|
||||
u32 volume = vm->m_area.getVolume();
|
||||
|
||||
lua_newtable(L);
|
||||
if (use_buffer)
|
||||
lua_pushvalue(L, 2);
|
||||
else
|
||||
lua_newtable(L);
|
||||
|
||||
for (u32 i = 0; i != volume; i++) {
|
||||
lua_Integer param2 = vm->m_data[i].param2;
|
||||
lua_pushinteger(L, param2);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue