Show also +0.00 split, and checkpoints close to start (<1sec)

This commit is contained in:
c0d3d3v 2022-07-03 13:31:54 +02:00
parent 6869530314
commit a961151b32
No known key found for this signature in database
GPG key ID: 068AF680530DFF31
3 changed files with 17 additions and 22 deletions

View file

@ -1632,7 +1632,7 @@ void CHud::OnMessage(int MsgType, void *pRawMsg)
m_FinishTime = pMsg->m_Finish != 0;
if(pMsg->m_Check)
if(!m_FinishTime)
{
m_CheckpointDiff = (float)pMsg->m_Check / 100;
m_CheckpointTick = Client()->GameTick(g_Config.m_ClDummy);

View file

@ -1341,31 +1341,26 @@ bool CCharacter::IsSwitchActiveCb(int Number, void *pUser)
return !aSwitchers.empty() && pThis->Team() != TEAM_SUPER && aSwitchers[Number].m_Status[pThis->Team()];
}
void CCharacter::SetTimeCheckpoint(int TimeCpNumber)
void CCharacter::SetTimeCheckpoint(int TimeCheckpoint)
{
if(TimeCpNumber != -1 && m_DDRaceState == DDRACE_STARTED && TimeCpNumber > m_CpActive)
if(TimeCheckpoint != -1 && m_DDRaceState == DDRACE_STARTED && TimeCheckpoint > m_CpActive)
{
m_CpActive = TimeCpNumber;
m_CpCurrent[TimeCpNumber] = m_Time;
m_CpActive = TimeCheckpoint;
m_CpCurrent[TimeCheckpoint] = m_Time;
m_CpTick = Server()->Tick() + Server()->TickSpeed() * 2;
if(m_pPlayer->GetClientVersion() >= VERSION_DDRACE)
{
CPlayerData *pData = GameServer()->Score()->PlayerData(m_pPlayer->GetCID());
CNetMsg_Sv_DDRaceTime Msg;
Msg.m_Time = (int)m_Time;
Msg.m_Check = 0;
Msg.m_Finish = 0;
if(m_CpActive != -1 && m_CpTick > Server()->Tick())
if(pData->m_BestTime && pData->m_aBestCpTime[m_CpActive] != 0 && m_CpActive != -1)
{
if(pData->m_BestTime && pData->m_aBestCpTime[m_CpActive] != 0)
{
float Diff = (m_CpCurrent[m_CpActive] - pData->m_aBestCpTime[m_CpActive]) * 100;
Msg.m_Check = (int)Diff;
}
CNetMsg_Sv_DDRaceTime Msg;
Msg.m_Time = (int)(m_Time * 100.0f);
Msg.m_Check = 0;
Msg.m_Finish = 0;
float Diff = (m_CpCurrent[m_CpActive] - pData->m_aBestCpTime[m_CpActive]) * 100;
Msg.m_Check = (int)Diff;
Server()->SendPackMsg(&Msg, MSGFLAG_VITAL, m_pPlayer->GetCID());
}
Server()->SendPackMsg(&Msg, MSGFLAG_VITAL, m_pPlayer->GetCID());
}
}
}
@ -1386,9 +1381,9 @@ void CCharacter::HandleTiles(int Index)
}
SetTimeCheckpoint(Collision()->IsTimeCheckpoint(MapIndex));
SetTimeCheckpoint(Collision()->IsFTimeCheckpoint(MapIndex));
int tcp = Collision()->IsTeleCheckpoint(MapIndex);
if(tcp)
m_TeleCheckpoint = tcp;
int TeleCheckpoint = Collision()->IsTeleCheckpoint(MapIndex);
if(TeleCheckpoint)
m_TeleCheckpoint = TeleCheckpoint;
GameServer()->m_pController->HandleCharacterTiles(this, Index);

View file

@ -143,7 +143,7 @@ private:
void SnapCharacter(int SnappingClient, int ID);
static bool IsSwitchActiveCb(int Number, void *pUser);
void SetTimeCheckpoint(int TimeCpNumber);
void SetTimeCheckpoint(int TimeCheckpoint);
void HandleTiles(int Index);
float m_Time;
int m_LastBroadcast;