Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kwolekr committed Mar 30, 2016
1 parent 597c1d7 commit 0115da1
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/mapgen.cpp
Expand Up @@ -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
Expand Down

0 comments on commit 0115da1

Please sign in to comment.