Make sure VoxelPropJob calls next job and sets itself to complete properly on every codepath.

This commit is contained in:
Relintai 2020-10-20 22:04:29 +02:00
parent 50701f1740
commit 9824738095

View File

@ -110,13 +110,15 @@ void VoxelPropJob::phase_prop() {
Ref<VoxelChunkDefault> chunk = _chunk; Ref<VoxelChunkDefault> chunk = _chunk;
if (!get_prop_mesher().is_valid()) { if (!get_prop_mesher().is_valid()) {
next_phase(); set_complete(true); //So threadpool knows it's done
next_job();
return; return;
} }
if (should_do()) { if (should_do()) {
if (chunk->get_mesh_data_resource_count() == 0) { if (chunk->get_mesh_data_resource_count() == 0) {
next_phase(); set_complete(true); //So threadpool knows it's done
next_job();
return; return;
} }
@ -127,9 +129,10 @@ void VoxelPropJob::phase_prop() {
} }
if (get_prop_mesher()->get_vertex_count() == 0) { if (get_prop_mesher()->get_vertex_count() == 0) {
reset_stages(); //reset_stages();
next_phase(); set_complete(true); //So threadpool knows it's done
next_job();
return; return;
} }
@ -372,6 +375,7 @@ void VoxelPropJob::_reset() {
} }
VoxelPropJob::VoxelPropJob() { VoxelPropJob::VoxelPropJob() {
set_build_phase_type(BUILD_PHASE_TYPE_PHYSICS_PROCESS);
} }
VoxelPropJob::~VoxelPropJob() { VoxelPropJob::~VoxelPropJob() {