diff options
author | paramat <mat.gregory@virginmedia.com> | 2015-12-02 03:28:03 +0000 |
---|---|---|
committer | paramat <mat.gregory@virginmedia.com> | 2015-12-07 03:18:24 +0000 |
commit | 49073ba2c34dfd8e286865ed2d108a4ec1eb3e3c (patch) | |
tree | 2372b48d5bfd846775ced52653afa92883e0a20c /src/script/lua_api | |
parent | a78dd7f2b6b0e1fefdbaa1ae21b722dd4459e4f4 (diff) | |
download | minetest-49073ba2c34dfd8e286865ed2d108a4ec1eb3e3c.tar.gz minetest-49073ba2c34dfd8e286865ed2d108a4ec1eb3e3c.tar.bz2 minetest-49073ba2c34dfd8e286865ed2d108a4ec1eb3e3c.zip |
Mapgen: Add propagate_shadow bool to calcLighting
To terminate unwanted shadows from floatlands or realms above
Also add to LuaVoxelManip calc_lighting for use in mapgen mods
Remove the 2 argument calcLighting, mapgens now use the 5
argument form to specify the volumes for propagateSunlight and
spreadLight
In mgsinglenode replace calcLighting with setLighting and
clean-up use of tabs and spaces
Diffstat (limited to 'src/script/lua_api')
-rw-r--r-- | src/script/lua_api/l_vmanip.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/script/lua_api/l_vmanip.cpp b/src/script/lua_api/l_vmanip.cpp index ec9be8fba..f13866408 100644 --- a/src/script/lua_api/l_vmanip.cpp +++ b/src/script/lua_api/l_vmanip.cpp @@ -181,6 +181,7 @@ int LuaVoxelManip::l_calc_lighting(lua_State *L) v3s16 fpmax = vm->m_area.MaxEdge; v3s16 pmin = lua_istable(L, 2) ? check_v3s16(L, 2) : fpmin + yblock; v3s16 pmax = lua_istable(L, 3) ? check_v3s16(L, 3) : fpmax - yblock; + bool propagate_shadow = lua_isboolean(L, 4) ? lua_toboolean(L, 4) : true; sortBoxVerticies(pmin, pmax); if (!vm->m_area.contains(VoxelArea(pmin, pmax))) @@ -191,7 +192,7 @@ int LuaVoxelManip::l_calc_lighting(lua_State *L) mg.ndef = ndef; mg.water_level = emerge->params.water_level; - mg.calcLighting(pmin, pmax, fpmin, fpmax); + mg.calcLighting(pmin, pmax, fpmin, fpmax, propagate_shadow); return 0; } |