Skip to content

Commit 7e92273

Browse files
authored
Scripts/Commands: Fix integer underflow in .pinfo ban time display (#31727)
1 parent 7ea4b1d commit 7e92273

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/server/scripts/Commands/cs_misc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1848,7 +1848,7 @@ class misc_commandscript : public CommandScript
18481848

18491849
// Output III. LANG_PINFO_BANNED if ban exists and is applied
18501850
if (banTime >= 0)
1851-
handler->PSendSysMessage(LANG_PINFO_BANNED, banType.c_str(), banReason.c_str(), banTime > 0 ? secsToTimeString(banTime - GameTime::GetGameTime(), TimeFormat::ShortText).c_str() : handler->GetTrinityString(LANG_PERMANENTLY), bannedBy.c_str());
1851+
handler->PSendSysMessage(LANG_PINFO_BANNED, banType.c_str(), banReason.c_str(), banTime > 0 ? secsToTimeString(std::max<int64>(banTime - GameTime::GetGameTime(), 0), TimeFormat::ShortText).c_str() : handler->GetTrinityString(LANG_PERMANENTLY), bannedBy.c_str());
18521852

18531853
// Output IV. LANG_PINFO_MUTED if mute is applied
18541854
if (muteTime > 0)

0 commit comments

Comments
 (0)