From 1a66fb9c170c1dee5993560dbefda93d9178a527 Mon Sep 17 00:00:00 2001 From: def Date: Wed, 21 Nov 2018 23:20:55 +0100 Subject: [PATCH] Serverside special handling for 9999 second time --- src/game/server/gamecontext.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp index 5c9cd47c6..ab32d5fcd 100644 --- a/src/game/server/gamecontext.cpp +++ b/src/game/server/gamecontext.cpp @@ -1836,7 +1836,16 @@ void CGameContext::OnMessage(int MsgID, CUnpacker *pUnpacker, int ClientID) Score()->PlayerData(ClientID)->Reset(); Score()->LoadScore(ClientID); Score()->PlayerData(ClientID)->m_CurrentTime = Score()->PlayerData(ClientID)->m_BestTime; - m_apPlayers[ClientID]->m_Score = (Score()->PlayerData(ClientID)->m_BestTime)?Score()->PlayerData(ClientID)->m_BestTime:-9999; + + // -9999 stands for no time and isn't displayed in scoreboard, so + // shift the time by a second if the player actually took 9999 + // seconds to finish the map. + if(!Score()->PlayerData(ClientID)->m_BestTime) + m_apPlayers[ClientID]->m_Score = -9999; + else if((int)Score()->PlayerData(ClientID)->m_BestTime == -9999) + m_apPlayers[ClientID]->m_Score = -10000; + else + m_apPlayers[ClientID]->m_Score = Score()->PlayerData(ClientID)->m_BestTime; } Server()->SetClientClan(ClientID, pMsg->m_pClan); Server()->SetClientCountry(ClientID, pMsg->m_Country);