From 05537cc8d8517da0b4282da564c816d8a5a1df50 Mon Sep 17 00:00:00 2001 From: momo5502 Date: Thu, 29 Dec 2016 15:59:27 +0100 Subject: [PATCH] [FastFiles] Never return progress higher than 1 --- src/Components/Modules/FastFiles.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Components/Modules/FastFiles.cpp b/src/Components/Modules/FastFiles.cpp index 5ca5516c..26acdd92 100644 --- a/src/Components/Modules/FastFiles.cpp +++ b/src/Components/Modules/FastFiles.cpp @@ -372,7 +372,7 @@ namespace Components float singleProgress = 1.0f / FastFiles::MaxZones; float partialProgress = singleProgress * (FastFiles::CurrentZone - 1); 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)