Merge pull request #41302 from Jlalond/divide-by-zero

Update ResourceLoaderText::load to not update progress if resources a…
This commit is contained in:
Rémi Verschelde 2020-08-16 22:37:27 +02:00 committed by GitHub
commit a17fba3f21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);
}