summaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_env.cpp
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2014-12-27 23:09:36 -0500
committerkwolekr <kwolekr@minetest.net>2014-12-27 23:09:36 -0500
commit8334100fe1b1bb40bfebff9ec9780c18fe3fd0c7 (patch)
treecacc08e1c21b30d976e755581d8a6abd93b1b1e9 /src/script/lua_api/l_env.cpp
parentae2721f2c84183cea4e447009a59ce606601702e (diff)
downloadminetest-8334100fe1b1bb40bfebff9ec9780c18fe3fd0c7.tar.gz
minetest-8334100fe1b1bb40bfebff9ec9780c18fe3fd0c7.tar.bz2
minetest-8334100fe1b1bb40bfebff9ec9780c18fe3fd0c7.zip
LuaVoxelManip: Add option to allocate blank data
Diffstat (limited to 'src/script/lua_api/l_env.cpp')
-rw-r--r--src/script/lua_api/l_env.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/script/lua_api/l_env.cpp b/src/script/lua_api/l_env.cpp
index 3d2e20424..9e713b9b8 100644
--- a/src/script/lua_api/l_env.cpp
+++ b/src/script/lua_api/l_env.cpp
@@ -638,6 +638,13 @@ int ModApiEnvMod::l_get_voxel_manip(lua_State *L)
Map *map = &(env->getMap());
LuaVoxelManip *o = new LuaVoxelManip(map);
+ if (lua_istable(L, 1) && lua_istable(L, 2)) {
+ v3s16 p1 = getNodeBlockPos(read_v3s16(L, 1));
+ v3s16 p2 = getNodeBlockPos(read_v3s16(L, 2));
+ sortBoxVerticies(p1, p2);
+ o->vm->initializeBlank(p1, p2);
+ }
+
*(void **)(lua_newuserdata(L, sizeof(void *))) = o;
luaL_getmetatable(L, "VoxelManip");
lua_setmetatable(L, -2);