mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
fixed "you were worse" message after finishing the first time, prevented that you get this message if your time is equal to your record
This commit is contained in:
parent
a156d15bd1
commit
dcb0b0ee1d
|
@ -616,10 +616,17 @@ void CCharacter::OnFinish()
|
|||
else
|
||||
GameServer()->SendChat(-1, CGameContext::CHAT_ALL, aBuf);
|
||||
}
|
||||
else
|
||||
else if(pData->m_BestTime != 0) // tee has already finished?
|
||||
{
|
||||
str_format(aBuf, sizeof(aBuf), "%5.2f second(s) worse, better luck next time.", fabs(pData->m_BestTime - time));
|
||||
if(fabs(time - pData->m_BestTime) <= 0.005)
|
||||
{
|
||||
GameServer()->SendChatTarget(m_pPlayer->GetCID(), "You finished with your best time.");
|
||||
}
|
||||
else
|
||||
{
|
||||
str_format(aBuf, sizeof(aBuf), "%5.2f second(s) worse, better luck next time.", fabs(pData->m_BestTime - time));
|
||||
GameServer()->SendChatTarget(m_pPlayer->GetCID(), aBuf);//this is private, sent only to the tee
|
||||
}
|
||||
}
|
||||
|
||||
if(!pData->m_BestTime || time < pData->m_BestTime)
|
||||
|
|
Loading…
Reference in a new issue