From 85c0acbfb93263da67b05b1e44dfa521d23d2ae1 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Thu, 12 Nov 2026 03:52:07 +0000 Subject: [PATCH] Decompile 2 functions in Source/Client/Mode/GameMode.cpp, Source/Client/Mode/GameModeHandlers.cpp, ... Batch #17805 by eAthena: 0 byte-identical, 2 confirmed by peer review. - fn_21414 CGameMode::GetActiveSkillEffectTimeText: logic confirmed by peer review - fn_17182 IntToSignedString: logic confirmed by peer review Peer-reviewed-by: Yommy, alisonrag, cremane Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Client/Mode/GameMode.cpp | 5 +++-- Source/Utility/Text/FormatString.cpp | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) 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);