diff options
author | jjjlalonde@gmail.com <jjjlalonde@gmail.com> | 2020-08-15 22:20:20 -0700 |
---|---|---|
committer | jjjlalonde@gmail.com <jjjlalonde@gmail.com> | 2020-08-16 13:12:21 -0700 |
commit | 94b09da9a137a755a80554f13ef7cbee7ac032b8 (patch) | |
tree | c57fc978b940c13c93bf4344810e6a4ea0210f46 | |
parent | ac5619f521eb31becd2b10ba524eb7c0eadae7dc (diff) |
Update ResourceLoaderText::load to not update progress if resources are 0
Include check in other progress update statement
Update additional progress update statement
-rw-r--r-- | scene/resources/resource_format_text.cpp | 6 |
1 files 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); } |