From 5294b88df9463cc8b8c46f1093d081c5332a43af Mon Sep 17 00:00:00 2001 From: Aaron Griffith Date: Sat, 16 Apr 2011 19:33:21 -0400 Subject: [PATCH] more fixes for spawn overlay at z == 127 --- src/rendermode-spawn.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/rendermode-spawn.c b/src/rendermode-spawn.c index 0d5138e..ff73780 100644 --- a/src/rendermode-spawn.c +++ b/src/rendermode-spawn.c @@ -43,12 +43,14 @@ static void get_color(void *data, RenderState *state, } Py_DECREF(block_py); - /* if we're at the top, use the top-most light instead */ - if (z_light == 128) - z_light--; + blocklight = getArrayByte3D(self->blocklight, x, y, MAX(127, z_light)); - blocklight = getArrayByte3D(self->blocklight, x, y, z_light); - skylight = getArrayByte3D(self->skylight, x, y, z_light); + /* if we're at the top, force 15 (brightest!) skylight */ + if (z_light == 128) { + skylight = 15; + } else { + skylight = getArrayByte3D(self->skylight, x, y, z_light); + } if (MAX(blocklight, skylight) <= 7) { /* hostile mobs spawn in daylight */