From 94b09da9a137a755a80554f13ef7cbee7ac032b8 Mon Sep 17 00:00:00 2001 From: "jjjlalonde@gmail.com" Date: Sat, 15 Aug 2020 22:20:20 -0700 Subject: Update ResourceLoaderText::load to not update progress if resources are 0 Include check in other progress update statement Update additional progress update statement --- scene/resources/resource_format_text.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scene/resources/resource_format_text.cpp b/scene/resources/resource_format_text.cpp index 93db8b725f..d4d8018d43 100644 --- a/scene/resources/resource_format_text.cpp +++ b/scene/resources/resource_format_text.cpp @@ -572,7 +572,7 @@ Error ResourceLoaderText::load() { } } - if (progress) { + if (progress && resources_total > 0) { *progress = resource_current / float(resources_total); } } @@ -640,7 +640,7 @@ Error ResourceLoaderText::load() { return error; } else { error = OK; - if (progress) { + if (progress && resources_total > 0) { *progress = resource_current / float(resources_total); } @@ -674,7 +674,7 @@ Error ResourceLoaderText::load() { resource_current++; - if (progress) { + if (progress && resources_total > 0) { *progress = resource_current / float(resources_total); } -- cgit v1.2.3