diff --git a/Source/Client/Mode/GameMode.cpp b/Source/Client/Mode/GameMode.cpp index 682c5af74..450d652e1 100644 --- a/Source/Client/Mode/GameMode.cpp +++ b/Source/Client/Mode/GameMode.cpp @@ -619,9 +619,10 @@ std::string CGameMode::GetActiveSkillEffectTimeText(int skillId, int* activeSkil output = buffer; } + int secondsPerMinute = 60; const int remainder = remainingSeconds - hours * 3600; - const int minutes = remainder / 60; - const int seconds = remainder % 60; + const int minutes = remainder / secondsPerMinute; + const int seconds = remainder % secondsPerMinute; if (minutes != 0) { std::sprintf(buffer, " %d %s", minutes, LookupMessage(MSI_MINUTE)); output = output + buffer; diff --git a/Source/Utility/Text/FormatString.cpp b/Source/Utility/Text/FormatString.cpp index c4f35c577..1a2a3ad1d 100644 --- a/Source/Utility/Text/FormatString.cpp +++ b/Source/Utility/Text/FormatString.cpp @@ -117,7 +117,8 @@ std::string IntToSignedString(int value, bool grouped, bool showPlus) { std::string text; const bool negative = value < 0; for (std::size_t i = 0; i < digits.size(); ++i) { - if ((digits.size() - i) % 3 == 0) { + std::size_t remaining = digits.size() - i; + if (remaining % 3 == 0) { text += std::string(","); } text += digits.at(i);