mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Revert conversion float=> char*=>int
This commit is contained in:
parent
b0bf68c3d3
commit
b67de28a0c
|
@ -735,11 +735,11 @@ void CCharacter::Tick()
|
|||
if(g_Config.m_SvHideScore || i == m_pPlayer->GetCID())
|
||||
{
|
||||
CNetMsg_Sv_PlayerTime Msg;
|
||||
//char aBuf[16];
|
||||
//str_format(aBuf, sizeof(aBuf), "%.0f", time*100.0f); // damn ugly but the only way i know to do it
|
||||
//int TimeToSend;
|
||||
//sscanf(aBuf, "%d", &TimeToSend);
|
||||
Msg.m_Time = static_cast<int>(time*100.0f);
|
||||
char aBuf[16];
|
||||
str_format(aBuf, sizeof(aBuf), "%.0f", time*100.0f); // damn ugly but the only way i know to do it
|
||||
int TimeToSend;
|
||||
sscanf(aBuf, "%d", &TimeToSend);
|
||||
Msg.m_Time = TimeToSend;
|
||||
Msg.m_Cid = m_pPlayer->GetCID();
|
||||
Server()->SendPackMsg(&Msg, MSGFLAG_VITAL, i);
|
||||
}
|
||||
|
|
|
@ -95,12 +95,12 @@ void CPlayer::Tick()
|
|||
if(m_LastSentTime > GameServer()->m_pController->m_CurrentRecord || (m_LastSentTime == 0 && GameServer()->m_pController->m_CurrentRecord > 0))
|
||||
{
|
||||
//dbg_msg("player", "Record message sended");
|
||||
//char aBuf[16];
|
||||
//str_format(aBuf, sizeof(aBuf), "%.0f", GameServer()->m_pController->m_CurrentRecord*100.0f); // damn ugly but the only way i know to do it
|
||||
//int TimeToSend;
|
||||
//sscanf(aBuf, "%d", &TimeToSend);
|
||||
char aBuf[16];
|
||||
str_format(aBuf, sizeof(aBuf), "%.0f", GameServer()->m_pController->m_CurrentRecord*100.0f); // damn ugly but the only way i know to do it
|
||||
int TimeToSend;
|
||||
sscanf(aBuf, "%d", &TimeToSend);
|
||||
CNetMsg_Sv_Record Msg;
|
||||
Msg.m_Time = static_cast<int>(GameServer()->m_pController->m_CurrentRecord*100.0f);
|
||||
Msg.m_Time = TimeToSend;
|
||||
Server()->SendPackMsg(&Msg, MSGFLAG_VITAL, m_ClientID);
|
||||
|
||||
m_LastSentTime = GameServer()->m_pController->m_CurrentRecord;
|
||||
|
|
Loading…
Reference in a new issue