From 9de15f0b0f30cc6e73c1111de61835a1c467412e Mon Sep 17 00:00:00 2001 From: Relintai Date: Wed, 7 Oct 2020 11:54:30 +0200 Subject: [PATCH] Uncomment a mesh data resource check. Also handle if phase gets too high in VoxelTerrarinJob. --- world/jobs/voxel_prop_job.cpp | 4 ++-- world/jobs/voxel_terrarin_job.cpp | 15 ++++++++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/world/jobs/voxel_prop_job.cpp b/world/jobs/voxel_prop_job.cpp index 415acaa..5056731 100644 --- a/world/jobs/voxel_prop_job.cpp +++ b/world/jobs/voxel_prop_job.cpp @@ -334,9 +334,9 @@ void VoxelPropJob::_execute_phase() { Ref chunk = _chunk; if (!chunk.is_valid() - //#ifdef MESH_DATA_RESOURCE_PRESENT +#ifdef MESH_DATA_RESOURCE_PRESENT || chunk->get_mesh_data_resource_count() == 0 - //#endif +#endif ) { set_complete(true); next_job(); diff --git a/world/jobs/voxel_terrarin_job.cpp b/world/jobs/voxel_terrarin_job.cpp index c5fa045..a12f9b0 100644 --- a/world/jobs/voxel_terrarin_job.cpp +++ b/world/jobs/voxel_terrarin_job.cpp @@ -575,16 +575,21 @@ void VoxelTerrarinJob::_execute_phase() { ERR_FAIL_COND(!library.is_valid()); - if (_phase == 0) + if (_phase == 0) { phase_setup(); - else if (_phase == 1) + } else if (_phase == 1) { phase_terrarin_mesh_setup(); - else if (_phase == 2) + } else if (_phase == 2) { phase_collider(); - else if (_phase == 4) + } else if (_phase == 4) { phase_terrarin_mesh(); - else if (_phase == 5) + } else if (_phase == 5) { phase_finalize(); + } else if (_phase > 5) { + set_complete(true); //So threadpool knows it's done + next_job(); + ERR_FAIL_MSG("VoxelTerrarinJob: _phase is too high!"); + } } void VoxelTerrarinJob::_reset() {