mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-14 17:15:21 +02:00
Light update for map blocks
This is not really different from the light update of a voxel manipulator. This update does not assume that the lighting was correct before, therefore it is useful for correction. Also expose this function to the Lua API for light correction, and allow voxel manipulators not to update the light.
This commit is contained in:
@@ -110,9 +110,10 @@ int LuaVoxelManip::l_write_to_map(lua_State *L)
|
||||
MAP_LOCK_REQUIRED;
|
||||
|
||||
LuaVoxelManip *o = checkobject(L, 1);
|
||||
bool update_light = lua_isboolean(L, 2) ? lua_toboolean(L, 2) : true;
|
||||
GET_ENV_PTR;
|
||||
ServerMap *map = &(env->getServerMap());
|
||||
if (o->is_mapgen_vm) {
|
||||
if (o->is_mapgen_vm || !update_light) {
|
||||
o->vm->blitBackAll(&(o->modified_blocks));
|
||||
} else {
|
||||
voxalgo::blit_back_with_light(map, o->vm,
|
||||
|
Reference in New Issue
Block a user