mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 06:28:19 +00:00
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:
parent
37a08e8ef0
commit
727b9f84b6
|
@ -171,6 +171,7 @@ public:
|
|||
bool m_NinjaJetpack;
|
||||
bool m_Afk;
|
||||
int m_KillMe;
|
||||
bool m_HasFinishScore;
|
||||
|
||||
int m_ChatScore;
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue