Fix logic for deciding if a cell needs a light update.

When a light-emitting block is replaced with one that emits less light, and the light drawn into the block from neighbors is greater than the light emitted by the new block, the drawn light should be considered the new light rather than the block's brightness.
This commit is contained in:
David Vierra 2015-09-28 21:02:54 -10:00
parent eb6facc20c
commit bcbf61f82c

View File

@ -422,11 +422,12 @@ def updateLightsInSelection(dim, selection):
cdef void updateLights(RelightCtx ctx, int x, int y, int z):
cdef char previousLight = ctx.getBlockLight(x, y, z)
cdef char light = ctx.getBlockBrightness(x, y, z)
ctx.setBlockLight(x, y, z, light)
cdef char light
ctx.setBlockLight(x, y, z, ctx.getBlockBrightness(x, y, z))
# should be able to often skip this if we can get block's previous opacity in here... bluh
drawLight(ctx, x, y, z)
light = ctx.getBlockLight(x, y, z)
if previousLight < light:
spreadLight(ctx, x, y, z)