0

made sure lava blocks are fully lit

This commit is contained in:
Aaron Griffith
2010-10-14 14:02:04 -04:00
parent c11e23a18f
commit 66e39f8b4d

View File

@@ -372,9 +372,11 @@ class ChunkRenderer(object):
# we have no useful info, return default # we have no useful info, return default
return (self.calculate_darkness(15, 0), False) return (self.calculate_darkness(15, 0), False)
blocktype = blocks[local_x, local_y, local_z]
# special handling for half-blocks # special handling for half-blocks
# (don't recurse more than once!) # (don't recurse more than once!)
if blocks[local_x, local_y, local_z] == 44 and not norecurse: if blocktype == 44 and not norecurse:
# average gathering variables # average gathering variables
averagegather = 0.0 averagegather = 0.0
averagecount = 0 averagecount = 0
@@ -395,9 +397,13 @@ class ChunkRenderer(object):
return (averagegather / averagecount, False) return (averagegather / averagecount, False)
# calculate the return... # calculate the return...
occluded = not (blocks[local_x, local_y, local_z] in transparent_blocks) occluded = not (blocktype in transparent_blocks)
# only calculate the non-default coefficient if we're not occluded # only calculate the non-default coefficient if we're not occluded
if occluded: if (blocktype == 10) or (blocktype == 11):
# lava blocks should always be lit!
coefficient = 0.0
elif occluded:
coefficient = self.calculate_darkness(15, 0) coefficient = self.calculate_darkness(15, 0)
else: else:
coefficient = self.calculate_darkness(skylight[local_x, local_y, local_z], blocklight[local_x, local_y, local_z]) coefficient = self.calculate_darkness(skylight[local_x, local_y, local_z], blocklight[local_x, local_y, local_z])