processRegionVoxels fix

This commit is contained in:
MihailRis
2024-04-15 01:27:02 +03:00
parent 0cbaa1ccc6
commit d955a0ead3
2 changed files with 3 additions and 1 deletions
+2 -1
View File
@@ -598,9 +598,10 @@ void WorldFiles::processRegionVoxels(int x, int z, regionproc func) {
int gx = cx + x * REGION_SIZE;
int gz = cz + z * REGION_SIZE;
uint32_t length;
std::unique_ptr<ubyte[]> data (readChunkData(gx, gz, length, regfile.get()));
auto data = readChunkData(gx, gz, length, regfile.get());
if (data == nullptr)
continue;
data = decompress(data.get(), length, CHUNK_DATA_LEN);
if (func(data.get())) {
put(gx, gz, REGION_LAYER_VOXELS, std::move(data), CHUNK_DATA_LEN, true);
}