summaryrefslogtreecommitdiff
path: root/src/map.cpp
diff options
context:
space:
mode:
authorDániel Juhász <juhdanad@gmail.com>2017-03-11 17:07:04 +0100
committerEkdohibs <nathanael.courant@laposte.net>2017-04-20 05:39:14 +0200
commit57e5aa662851485902575c3c747437e365bf72c8 (patch)
tree3e8469a85db5577140110e5d87a98514f5dd8d2f /src/map.cpp
parent6d1e6f889826a5802e17f53f99000a51b2e00066 (diff)
downloadminetest-57e5aa662851485902575c3c747437e365bf72c8.tar.gz
minetest-57e5aa662851485902575c3c747437e365bf72c8.tar.bz2
minetest-57e5aa662851485902575c3c747437e365bf72c8.zip
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.
Diffstat (limited to 'src/map.cpp')
-rw-r--r--src/map.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/map.cpp b/src/map.cpp
index f8bbee180..8754813dd 100644
--- a/src/map.cpp
+++ b/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),