fixed scoreboard update for slow racers (less hacky) (#765)

* fixed scoreboard update for slow racers (less hacky)

* Fix some style issues
This commit is contained in:
ChillerDragon 2017-07-05 23:01:57 +02:00 committed by heinrich5991
parent 37a08e8ef0
commit 727b9f84b6
4 changed files with 8 additions and 2 deletions

View file

@ -171,6 +171,7 @@ public:
bool m_NinjaJetpack;
bool m_Afk;
int m_KillMe;
bool m_HasFinishScore;
int m_ChatScore;

View file

@ -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)

View file

@ -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)

View file

@ -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)