FinishTime Difference

This commit is contained in:
GreYFoXGTi 2010-11-30 04:52:04 +02:00
parent af44a79b03
commit c149b17617
2 changed files with 8 additions and 3 deletions

View file

@ -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);
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())
{

View file

@ -661,9 +661,9 @@ void CCharacter::OnFinish()
m_DDRaceState = DDRACE_NONE;
// 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;
for(int i = 0; i < MAX_CLIENTS; i++)
{
@ -696,6 +696,12 @@ void CCharacter::OnFinish()
Msg.m_Check = 0;
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());
}