Skip to content

Commit

Permalink
Fixes getTimerDetails negative remaining duration (#3663)
Browse files Browse the repository at this point in the history
* Fixes negative numbers

Fixes negative remaining duration in current timer, remaining should always be 0

* Return in single statement

Co-authored-by: Nico <[email protected]>

* 0 > 0LL

---------

Co-authored-by: Nico <[email protected]>
Co-authored-by: TEDERIs <[email protected]>
  • Loading branch information
3 people authored Aug 24, 2024
1 parent 09e8350 commit 1c6cab5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Shared/mods/deathmatch/logic/lua/CLuaTimer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,5 @@ CTickCount CLuaTimer::GetTimeLeft()
{
CTickCount llCurrentTime = CTickCount::Now();
CTickCount llTimeLeft = m_llStartTime + m_llDelay - llCurrentTime;
return llTimeLeft;
return llTimeLeft.ToLongLong() < 0LL ? CTickCount(0LL) : llTimeLeft;
}

0 comments on commit 1c6cab5

Please sign in to comment.