Merge pull request #988 from CounterPillow/ftb-cave-fix
Fixed cave render for solid unknown blocks.
This commit is contained in:
@@ -147,6 +147,7 @@ block_has_property(unsigned short b, BlockProperty prop) {
|
||||
return block_properties[b] & (1 << prop);
|
||||
}
|
||||
#define is_transparent(b) block_has_property((b), TRANSPARENT)
|
||||
#define is_known_transparent(b) block_has_property((b), TRANSPARENT) && block_has_property((b), KNOWN)
|
||||
|
||||
/* helper for indexing section data possibly across section boundaries */
|
||||
typedef enum
|
||||
|
||||
@@ -43,9 +43,9 @@ cave_occluded(void *data, RenderState *state, int x, int y, int z) {
|
||||
/* check for normal occlusion */
|
||||
/* use ajacent chunks, if not you get blocks spreaded in chunk edges */
|
||||
|
||||
if (!is_transparent(get_data(state, BLOCKS, x-1, y, z)) &&
|
||||
!is_transparent(get_data(state, BLOCKS, x, y, z+1)) &&
|
||||
!is_transparent(get_data(state, BLOCKS, x, y+1, z))) {
|
||||
if (!is_known_transparent(get_data(state, BLOCKS, x-1, y, z)) &&
|
||||
!is_known_transparent(get_data(state, BLOCKS, x, y, z+1)) &&
|
||||
!is_known_transparent(get_data(state, BLOCKS, x, y+1, z))) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user