0

C: Amend logic in block_class_is_wall()

Resolves an issue where this function would mistakenly identify
various non-wall blocks as walls
This commit is contained in:
Joseph Camp
2020-08-06 23:24:12 +00:00
parent b29c9e9ffc
commit a839fa437d
2 changed files with 2 additions and 2 deletions

View File

@@ -62,7 +62,7 @@ bool block_class_is_wall(mc_block_t block) {
mc_block_t mask = 0b11111111; mc_block_t mask = 0b11111111;
mc_block_t prefix = 0b111 << 8; // 1792 is the starting offset mc_block_t prefix = 0b111 << 8; // 1792 is the starting offset
// if the xor zeroes all bits, the prefix must've matched. // if the xor zeroes all bits, the prefix must've matched.
return (block & ~mask) ^ prefix == 0; return ((block & ~mask) ^ prefix) == 0;
} }
const mc_block_t block_class_stair[] = { const mc_block_t block_class_stair[] = {

View File

@@ -31,7 +31,7 @@
// increment this value if you've made a change to the c extension // increment this value if you've made a change to the c extension
// and want to force users to rebuild // and want to force users to rebuild
#define OVERVIEWER_EXTENSION_VERSION 90 #define OVERVIEWER_EXTENSION_VERSION 91
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h> #include <stdint.h>