0

Fixes #1659 by testing both 8 and 9 for water blockid

This commit is contained in:
Daniel Grimwood
2019-12-29 15:38:56 +08:00
parent 9800c58c14
commit de5f27c446

View File

@@ -78,15 +78,15 @@ cave_hidden(void* data, RenderState* state, int32_t x, int32_t y, int32_t z) {
* at this point of the code the block has no skylight
* but a deep sea can be completely dark
*/
if ((getArrayShort3D(state->blocks, x, y, z) == 9) ||
(get_data(state, BLOCKS, x, y + 1, z) == 9)) {
if ((getArrayShort3D(state->blocks, x, y, z) == 9) || (getArrayShort3D(state->blocks, x, y, z) == 8) ||
(get_data(state, BLOCKS, x, y + 1, z) == 9) || (get_data(state, BLOCKS, x, y + 1, z) == 8)) {
for (dy = y + 1; dy < (SECTIONS_PER_CHUNK - state->chunky) * 16; dy++) {
/* go up and check for skylight */
if (get_data(state, SKYLIGHT, x, dy, z) != 0) {
return true;
}
if (get_data(state, BLOCKS, x, dy, z) != 9) {
if (get_data(state, BLOCKS, x, dy, z) != 8 && get_data(state, BLOCKS, x, dy, z) != 9) {
/* we are out of the water! and there's no skylight
* , i.e. is a cave lake or something similar */
break;