[FastFiles] Never return progress higher than 1

This commit is contained in:
momo5502 2016-12-29 15:59:27 +01:00
parent 3d7f3482c7
commit 05537cc8d8

View File

@ -372,7 +372,7 @@ namespace Components
float singleProgress = 1.0f / FastFiles::MaxZones; float singleProgress = 1.0f / FastFiles::MaxZones;
float partialProgress = singleProgress * (FastFiles::CurrentZone - 1); float partialProgress = singleProgress * (FastFiles::CurrentZone - 1);
float currentProgress = std::max(std::min(Game::DB_GetLoadedFraction(), 1.0f), 0.0f); float currentProgress = std::max(std::min(Game::DB_GetLoadedFraction(), 1.0f), 0.0f);
return partialProgress + (currentProgress * singleProgress); return std::min(partialProgress + (currentProgress * singleProgress), 1.0f);
} }
void FastFiles::LoadZonesStub(Game::XZoneInfo *zoneInfo, unsigned int zoneCount) void FastFiles::LoadZonesStub(Game::XZoneInfo *zoneInfo, unsigned int zoneCount)