From f9d13c611fb9816016fb162cf350c671cb705ec5 Mon Sep 17 00:00:00 2001 From: Relintai Date: Wed, 4 Mar 2020 20:12:15 +0100 Subject: [PATCH] Improved aborting chunk build. --- world/voxel_chunk.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/world/voxel_chunk.cpp b/world/voxel_chunk.cpp index d821f15..ef6f8e6 100644 --- a/world/voxel_chunk.cpp +++ b/world/voxel_chunk.cpp @@ -646,18 +646,18 @@ void VoxelChunk::build_prioritized() { void VoxelChunk::_build_step() { ERR_FAIL_COND(!has_next_phase()); - while (has_next_phase() && build_phase()) + while (has_next_phase() && build_phase() && !_abort_build) ; //call the next non-threaded phase aswell - if (has_next_phase()) + if (has_next_phase() && !_abort_build) build_phase(); } void VoxelChunk::_build_threaded(void *_userdata) { VoxelChunk *vc = (VoxelChunk *)_userdata; - while (vc->has_next_phase() && vc->build_phase()) + while (vc->has_next_phase() && vc->build_phase() && !vc->_abort_build) ; }