From 40ee3697e178de8036631f473c4155d6e9d45714 Mon Sep 17 00:00:00 2001 From: Marc Gilleron Date: Tue, 30 Aug 2022 19:35:25 +0100 Subject: [PATCH] Fix wrong condition --- terrain/fixed_lod/voxel_terrain.cpp | 2 +- util/ref_count.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/terrain/fixed_lod/voxel_terrain.cpp b/terrain/fixed_lod/voxel_terrain.cpp index 9ea72b5b..e70c39b4 100644 --- a/terrain/fixed_lod/voxel_terrain.cpp +++ b/terrain/fixed_lod/voxel_terrain.cpp @@ -1467,7 +1467,7 @@ void VoxelTerrain::apply_data_block_response(VoxelEngine::BlockDataOutput &ob) { }*/ // Create or update block data - const bool was_not_loaded = _data->has_block(block_pos, 0); + const bool was_not_loaded = !_data->has_block(block_pos, 0); VoxelDataBlock *block = _data->try_set_block_buffer( block_pos, 0, ob.voxels, ob.type == VoxelEngine::BlockDataOutput::TYPE_LOADED, true); if (block == nullptr) { diff --git a/util/ref_count.h b/util/ref_count.h index 4e9a47c6..ba654026 100644 --- a/util/ref_count.h +++ b/util/ref_count.h @@ -10,7 +10,7 @@ namespace zylann { class RefCount { public: RefCount() {} - RefCount(unsigned int initial_count): _count(initial_count) {} + RefCount(unsigned int initial_count) : _count(initial_count) {} inline void add() { ++_count;