diff options
Diffstat (limited to 'src/core/Stats.cpp')
-rw-r--r-- | src/core/Stats.cpp | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/src/core/Stats.cpp b/src/core/Stats.cpp index a4bf409e..32148476 100644 --- a/src/core/Stats.cpp +++ b/src/core/Stats.cpp @@ -209,19 +209,6 @@ void CStats::SetTotalNumberMissions(int32 total) TotalNumberMissions = total; } -float CStats::GetPercentageProgress() -{ - float p; - if (TotalProgressInGame == 0.0f) - p = 0.0f; - else if (CGame::nastyGame) - p = 100.0f * ProgressMade / TotalProgressInGame; - else - p = 100.0f * ProgressMade / (TotalProgressInGame - 1); - - return Min(100.0f, p); -} - wchar *CStats::FindCriminalRatingString() { int rating = FindCriminalRatingNumber(); @@ -263,6 +250,14 @@ int32 CStats::FindCriminalRatingNumber() return rating; } +float CStats::GetPercentageProgress() +{ + float percentCompleted = (CStats::TotalProgressInGame == 0 ? 0 : + CStats::ProgressMade * 100.0f / (CGame::nastyGame ? CStats::TotalProgressInGame : CStats::TotalProgressInGame - 1.0f)); + + return Min(percentCompleted, 100.0f); +} + void CStats::MoneySpentOnFashion(int32 money) { FashionBudget += money; |