From d931a53a1352be42d3a273c8da472d69bad0772c Mon Sep 17 00:00:00 2001 From: Relintai Date: Sun, 8 Aug 2021 13:22:40 +0200 Subject: [PATCH] Don't return in the terrain job if the cache is not initialized, wait instead. --- world/jobs/terra_terrarin_job.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/world/jobs/terra_terrarin_job.cpp b/world/jobs/terra_terrarin_job.cpp index b787b7c..b3808d2 100644 --- a/world/jobs/terra_terrarin_job.cpp +++ b/world/jobs/terra_terrarin_job.cpp @@ -108,16 +108,19 @@ void TerraTerrarinJob::phase_library_setup() { return; } - if (!cache->get_initialized()) { + while (!cache->get_initialized()) { //Means it's currently merging the atlases on a different thread. - //Let's just wait -> return. - //This method will get called again later. - return; + //Let's just wait + OS::get_singleton()->delay_usec(100); } } } next_phase(); + + if (should_return()) { + return; + } } void TerraTerrarinJob::phase_terrarin_mesh_setup() {