fix and refactor ContentLUT

This commit is contained in:
MihailRis
2024-06-25 23:36:07 +03:00
parent ee9f1639e9
commit 1acced4475
5 changed files with 99 additions and 107 deletions
+1 -1
View File
@@ -127,7 +127,7 @@ void Chunk::convert(ubyte* data, const ContentLUT* lut) {
// see encode method to understand what the hell is going on here
blockid_t id = ((static_cast<blockid_t>(data[i]) << 8) |
static_cast<blockid_t>(data[CHUNK_VOL+i]));
blockid_t replacement = lut->getBlockId(id);
blockid_t replacement = lut->blocks.getId(id);
data[i] = replacement >> 8;
data[CHUNK_VOL+i] = replacement & 0xFF;
}