mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 18:18:18 +00:00
On name change relaod scores, fixes %55
This commit is contained in:
parent
1bfcfb7d6f
commit
e6189d05c4
|
@ -1182,6 +1182,13 @@ void CGameContext::OnMessage(int MsgID, CUnpacker *pUnpacker, int ClientID)
|
||||||
char aChatText[256];
|
char aChatText[256];
|
||||||
str_format(aChatText, sizeof(aChatText), "'%s' changed name to '%s'", aOldName, Server()->ClientName(ClientID));
|
str_format(aChatText, sizeof(aChatText), "'%s' changed name to '%s'", aOldName, Server()->ClientName(ClientID));
|
||||||
SendChat(-1, CGameContext::CHAT_ALL, aChatText);
|
SendChat(-1, CGameContext::CHAT_ALL, aChatText);
|
||||||
|
|
||||||
|
// reload scores
|
||||||
|
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
Server()->SetClientClan(ClientID, pMsg->m_pClan);
|
Server()->SetClientClan(ClientID, pMsg->m_pClan);
|
||||||
Server()->SetClientCountry(ClientID, pMsg->m_Country);
|
Server()->SetClientCountry(ClientID, pMsg->m_Country);
|
||||||
|
|
Loading…
Reference in a new issue