diff --git a/src/game/server/player.h b/src/game/server/player.h index 2708356fe..5cd1bef41 100644 --- a/src/game/server/player.h +++ b/src/game/server/player.h @@ -171,6 +171,7 @@ public: bool m_NinjaJetpack; bool m_Afk; int m_KillMe; + bool m_HasFinishScore; int m_ChatScore; diff --git a/src/game/server/score/file_score.cpp b/src/game/server/score/file_score.cpp index 6db15bf4d..2859054e0 100644 --- a/src/game/server/score/file_score.cpp +++ b/src/game/server/score/file_score.cpp @@ -219,7 +219,10 @@ void CFileScore::LoadScore(int ClientID) // set score if (pPlayer) + { PlayerData(ClientID)->Set(pPlayer->m_Score, pPlayer->m_aCpTime); + GameServer()->m_apPlayers[ClientID]->m_HasFinishScore = true; + } } void CFileScore::SaveTeamScore(int* ClientIDs, unsigned int Size, float Time) diff --git a/src/game/server/score/sql_score.cpp b/src/game/server/score/sql_score.cpp index bc6ab73d2..376467e9e 100644 --- a/src/game/server/score/sql_score.cpp +++ b/src/game/server/score/sql_score.cpp @@ -236,7 +236,10 @@ bool CSqlScore::LoadScoreThread(CSqlServer* pSqlServer, const CSqlData *pGameDat pData->PlayerData(pData->m_ClientID)->m_BestTime = Time; pData->PlayerData(pData->m_ClientID)->m_CurrentTime = Time; if(pData->GameServer()->m_apPlayers[pData->m_ClientID]) + { pData->GameServer()->m_apPlayers[pData->m_ClientID]->m_Score = -Time; + pData->GameServer()->m_apPlayers[pData->m_ClientID]->m_HasFinishScore = true; + } char aColumn[8]; if(g_Config.m_SvCheckpointSave) diff --git a/src/game/server/teams.cpp b/src/game/server/teams.cpp index 70f06afe4..1d2473dee 100644 --- a/src/game/server/teams.cpp +++ b/src/game/server/teams.cpp @@ -594,9 +594,8 @@ void CGameTeams::OnFinish(CPlayer* Player) } int TTime = 0 - (int)Time; - if (Player->m_Score < TTime) + if (Player->m_Score < TTime || !Player->m_HasFinishScore) Player->m_Score = TTime; - } void CGameTeams::OnCharacterSpawn(int ClientID)