Better way of handling the previous improvement. It will actually work now properly aswell.

This commit is contained in:
Relintai 2020-03-04 20:49:00 +01:00
parent f9d13c611f
commit d08da0375a

View File

@ -646,18 +646,18 @@ void VoxelChunk::build_prioritized() {
void VoxelChunk::_build_step() { void VoxelChunk::_build_step() {
ERR_FAIL_COND(!has_next_phase()); ERR_FAIL_COND(!has_next_phase());
while (has_next_phase() && build_phase() && !_abort_build) while (has_next_phase() && build_phase())
; ;
//call the next non-threaded phase aswell //call the next non-threaded phase aswell
if (has_next_phase() && !_abort_build) if (has_next_phase())
build_phase(); build_phase();
} }
void VoxelChunk::_build_threaded(void *_userdata) { void VoxelChunk::_build_threaded(void *_userdata) {
VoxelChunk *vc = (VoxelChunk *)_userdata; VoxelChunk *vc = (VoxelChunk *)_userdata;
while (vc->has_next_phase() && vc->build_phase() && !vc->_abort_build) while (vc->has_next_phase() && vc->build_phase())
; ;
} }
@ -665,6 +665,9 @@ bool VoxelChunk::build_phase() {
_THREAD_SAFE_METHOD_ _THREAD_SAFE_METHOD_
if (_abort_build)
return false;
set_build_phase_done(false); set_build_phase_done(false);
return call("_build_phase", _current_build_phase); return call("_build_phase", _current_build_phase);