mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
FinishTime Difference
This commit is contained in:
parent
af44a79b03
commit
c149b17617
|
@ -339,7 +339,6 @@ void CHud::RenderDDRaceEffects()
|
||||||
{
|
{
|
||||||
str_format(aBuf, sizeof(aBuf), "Finish time: %02d:%02d.%02d", m_DDRaceTime/6000, m_DDRaceTime/100-m_DDRaceTime/6000 * 60, m_DDRaceTime % 100);
|
str_format(aBuf, sizeof(aBuf), "Finish time: %02d:%02d.%02d", m_DDRaceTime/6000, m_DDRaceTime/100-m_DDRaceTime/6000 * 60, m_DDRaceTime % 100);
|
||||||
TextRender()->Text(0, 150*Graphics()->ScreenAspect()-TextRender()->TextWidth(0,12,aBuf,-1)/2, 20, 12, aBuf, -1);
|
TextRender()->Text(0, 150*Graphics()->ScreenAspect()-TextRender()->TextWidth(0,12,aBuf,-1)/2, 20, 12, aBuf, -1);
|
||||||
m_CheckpointTick = 0;
|
|
||||||
}
|
}
|
||||||
else if(m_CheckpointTick + Client()->GameTickSpeed()*6 > Client()->GameTick())
|
else if(m_CheckpointTick + Client()->GameTickSpeed()*6 > Client()->GameTick())
|
||||||
{
|
{
|
||||||
|
|
|
@ -661,9 +661,9 @@ void CCharacter::OnFinish()
|
||||||
|
|
||||||
m_DDRaceState = DDRACE_NONE;
|
m_DDRaceState = DDRACE_NONE;
|
||||||
// set player score
|
// set player score
|
||||||
if(!GameServer()->Score()->PlayerData(m_pPlayer->GetCID())->m_CurrentTime || GameServer()->Score()->PlayerData(m_pPlayer->GetCID())->m_CurrentTime > time)
|
if(!pData->m_CurrentTime || pData->m_CurrentTime > time)
|
||||||
{
|
{
|
||||||
GameServer()->Score()->PlayerData(m_pPlayer->GetCID())->m_CurrentTime = time;
|
pData->m_CurrentTime = time;
|
||||||
NeedToSendNewRecord = true;
|
NeedToSendNewRecord = true;
|
||||||
for(int i = 0; i < MAX_CLIENTS; i++)
|
for(int i = 0; i < MAX_CLIENTS; i++)
|
||||||
{
|
{
|
||||||
|
@ -695,6 +695,12 @@ void CCharacter::OnFinish()
|
||||||
Msg.m_Time = (int)(time * 100.0f);
|
Msg.m_Time = (int)(time * 100.0f);
|
||||||
Msg.m_Check = 0;
|
Msg.m_Check = 0;
|
||||||
Msg.m_Finish = 1;
|
Msg.m_Finish = 1;
|
||||||
|
|
||||||
|
if(pData->m_BestTime)
|
||||||
|
{
|
||||||
|
float Diff = (time - pData->m_BestTime)*100;
|
||||||
|
Msg.m_Check = (int)Diff;
|
||||||
|
}
|
||||||
|
|
||||||
Server()->SendPackMsg(&Msg, MSGFLAG_VITAL, m_pPlayer->GetCID());
|
Server()->SendPackMsg(&Msg, MSGFLAG_VITAL, m_pPlayer->GetCID());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue