mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Don't load best time when already in progress
This commit is contained in:
parent
8452d8d028
commit
25e371fa8a
|
@ -176,6 +176,14 @@ void CGameControllerDDRace::Tick()
|
|||
if(m_pLoadBestTimeResult->m_Success)
|
||||
{
|
||||
m_CurrentRecord = m_pLoadBestTimeResult->m_CurrentRecord;
|
||||
|
||||
for(int i = 0; i < MAX_CLIENTS; i++)
|
||||
{
|
||||
if(GameServer()->m_apPlayers[i] && GameServer()->m_apPlayers[i]->GetClientVersion() >= VERSION_DDRACE)
|
||||
{
|
||||
GameServer()->SendRecord(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
m_pLoadBestTimeResult = nullptr;
|
||||
}
|
||||
|
|
|
@ -108,6 +108,9 @@ CScore::CScore(CGameContext *pGameServer, CDbConnectionPool *pPool) :
|
|||
|
||||
void CScore::LoadBestTime()
|
||||
{
|
||||
if(((CGameControllerDDRace *)(m_pGameServer->m_pController))->m_pLoadBestTimeResult)
|
||||
return; // already in progress
|
||||
|
||||
auto LoadBestTimeResult = std::make_shared<CScoreLoadBestTimeResult>();
|
||||
((CGameControllerDDRace *)(m_pGameServer->m_pController))->m_pLoadBestTimeResult = LoadBestTimeResult;
|
||||
|
||||
|
|
Loading…
Reference in a new issue