diff options
author | kwolekr <kwolekr@minetest.net> | 2016-03-29 23:59:39 -0400 |
---|---|---|
committer | kwolekr <kwolekr@minetest.net> | 2016-03-30 00:19:03 -0400 |
commit | 0115da1d6348a08388238d8728daaa048a603522 (patch) | |
tree | c34469f7d88cd587a224fed82bc398905c507b15 /src/mapgen.cpp | |
parent | 597c1d73da38ab299eb440a3429fce04da10cf05 (diff) | |
download | minetest-0115da1d6348a08388238d8728daaa048a603522.tar.gz minetest-0115da1d6348a08388238d8728daaa048a603522.tar.bz2 minetest-0115da1d6348a08388238d8728daaa048a603522.zip |
Mapgen: Don't spread light of nodes outside the desired area
This fixes #3935, a regression from 0338c2e.
An 'optimization' was performed where an index for the VoxelManip being
operated on was mistakenly used for bounds checking within the incorrect
VoxelArea, namely, the area wherein light should be spread.
Diffstat (limited to 'src/mapgen.cpp')
-rw-r--r-- | src/mapgen.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/mapgen.cpp b/src/mapgen.cpp index 29af83517..b3c9380a0 100644 --- a/src/mapgen.cpp +++ b/src/mapgen.cpp @@ -242,13 +242,10 @@ void Mapgen::setLighting(u8 light, v3s16 nmin, v3s16 nmax) void Mapgen::lightSpread(VoxelArea &a, v3s16 p, u8 light) { - if (light <= 1) + if (light <= 1 || !a.contains(p)) return; u32 vi = vm->m_area.index(p); - if (!a.contains(vi)) - return; - MapNode &n = vm->m_data[vi]; // Decay light in each of the banks separately |