mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 05:52:31 +02:00
fix for isAvailable boolean in AssetsBackupHandler
This commit is contained in:
parent
4bb8435ef8
commit
29349d7bb2
1 changed files with 10 additions and 3 deletions
|
@ -120,13 +120,20 @@ std::pair<bool, float> AssetsBackupHandler::isAvailable(QString filePath) {
|
||||||
return { true, 1.0f };
|
return { true, 1.0f };
|
||||||
}
|
}
|
||||||
|
|
||||||
float progress = (float)it->mappings.size();
|
int mappingsMissing = 0;
|
||||||
for (const auto& mapping : it->mappings) {
|
for (const auto& mapping : it->mappings) {
|
||||||
if (_assetsLeftToRequest.find(mapping.second) != end(_assetsLeftToRequest)) {
|
if (_assetsLeftToRequest.find(mapping.second) != end(_assetsLeftToRequest)) {
|
||||||
progress -= 1.0f;
|
++mappingsMissing;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
progress /= (float)it->mappings.size();
|
|
||||||
|
if (mappingsMissing == 0) {
|
||||||
|
return { true, 1.0f };
|
||||||
|
}
|
||||||
|
|
||||||
|
float progress = (float)it->mappings.size();
|
||||||
|
progress -= (float)mappingsMissing;
|
||||||
|
progress /= it->mappings.size();
|
||||||
|
|
||||||
return { false, progress };
|
return { false, progress };
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue