mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00: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:
parent
6d1e6f8898
commit
57e5aa6628
8 changed files with 209 additions and 3 deletions
10
src/map.cpp
10
src/map.cpp
|
@ -2591,6 +2591,16 @@ void ServerMap::PrintInfo(std::ostream &out)
|
|||
out<<"ServerMap: ";
|
||||
}
|
||||
|
||||
bool ServerMap::repairBlockLight(v3s16 blockpos,
|
||||
std::map<v3s16, MapBlock *> *modified_blocks)
|
||||
{
|
||||
MapBlock *block = emergeBlock(blockpos, false);
|
||||
if (!block || !block->isGenerated())
|
||||
return false;
|
||||
voxalgo::repair_block_light(this, block, modified_blocks);
|
||||
return true;
|
||||
}
|
||||
|
||||
MMVManip::MMVManip(Map *map):
|
||||
VoxelManipulator(),
|
||||
m_is_dirty(false),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue