mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Merge #1384
1384: Serverside special handling for 9999 second time r=heinrich5991 a=def- As requested by heinrich5991 Co-authored-by: def <dennis@felsin9.de>
This commit is contained in:
commit
e632cbbf14
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue