forked from Mirrorlandia_minetest/minetest
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.
This commit is contained in:
@ -242,13 +242,10 @@ void Mapgen::setLighting(u8 light, v3s16 nmin, v3s16 nmax)
|
|||||||
|
|
||||||
void Mapgen::lightSpread(VoxelArea &a, v3s16 p, u8 light)
|
void Mapgen::lightSpread(VoxelArea &a, v3s16 p, u8 light)
|
||||||
{
|
{
|
||||||
if (light <= 1)
|
if (light <= 1 || !a.contains(p))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
u32 vi = vm->m_area.index(p);
|
u32 vi = vm->m_area.index(p);
|
||||||
if (!a.contains(vi))
|
|
||||||
return;
|
|
||||||
|
|
||||||
MapNode &n = vm->m_data[vi];
|
MapNode &n = vm->m_data[vi];
|
||||||
|
|
||||||
// Decay light in each of the banks separately
|
// Decay light in each of the banks separately
|
||||||
|
Reference in New Issue
Block a user