Fix loading client score. Thanks GreYFoX

This commit is contained in:
btd 2010-09-26 19:18:56 +04:00 committed by GreYFoXGTi
parent 7ecae53f6c
commit e039cf6f35

View file

@ -529,16 +529,26 @@ void CGameContext::OnClientEnter(int ClientId)
{
//world.insert_entity(&players[client_id]);
m_apPlayers[ClientId]->Respawn();
m_apPlayers[ClientId]->m_Score = -9999;
// init the player
Score()->PlayerData(ClientId)->Reset();
Score()->LoadScore(ClientId);
char aBuf[512];
str_format(aBuf, sizeof(aBuf), "'%s' entered and joined the %s", Server()->ClientName(ClientId), m_pController->GetTeamName(m_apPlayers[ClientId]->GetTeam()));
SendChat(-1, CGameContext::CHAT_ALL, aBuf);
SendChatTarget(ClientId, "DDRace Mod. Version: " DDRACE_VERSION);
SendChatTarget(ClientId, "Official site: DDRace.info");
SendChatTarget(ClientId, "For more Info /CMDList");
SendChatTarget(ClientId, "Or visit DDRace.info");
SendChatTarget(ClientId, "To see this again say /info");
if (g_Config.m_SvWelcome[0]!=0) SendChatTarget(ClientId,g_Config.m_SvWelcome);
str_format(aBuf, sizeof(aBuf), "team_join player='%d:%s' team=%d", ClientId, Server()->ClientName(ClientId), m_apPlayers[ClientId]->GetTeam());
Console()->Print(IConsole::OUTPUT_LEVEL_DEBUG, "game", aBuf);
m_VoteUpdate = true;