synchronization protocol double/int conversion error fix

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/hilnius@13251 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hilnius 2013-07-15 15:44:21 +00:00
parent dc3b5fe35c
commit ec65fb96aa
2 changed files with 4 additions and 4 deletions

View File

@ -68,8 +68,8 @@ void SynchronizationProtocol::notifyEvent(Event* event)
Log::verbose("SynchronizationProtocol", "Answering sequence %u", sequence);
if (event->data.size() == 12 && !m_listener->isServer()) // countdown time in the message
{
uint16_t time_to_start = event->data.gui16(10);
Log::info("SynchronizationProtocol", "Starting game in %u.", time_to_start);
short time_to_start = event->data.gui16(10);
Log::info("SynchronizationProtocol", "Request to start game in %d.", time_to_start);
startCountdown(time_to_start);
}
else
@ -123,7 +123,7 @@ void SynchronizationProtocol::asynchronousUpdate()
// now add the countdown if necessary
if (m_countdown_activated)
{
ns.ai16(m_countdown);
ns.ai16((int)(m_countdown*1000.0));
Log::info("SynchronizationProtocol", "CNTActivated: Countdown value : %f", m_countdown);
}
Log::verbose("SynchronizationProtocol", "Added sequence number %u for peer %d", m_pings[i].size(), i);

View File

@ -463,7 +463,7 @@ void RaceManager::startNextRace()
}
StartGameProtocol* protocol = static_cast<StartGameProtocol*>(
ProtocolManager::getInstance()->getProtocol(PROTOCOL_SYNCHRONIZATION));
ProtocolManager::getInstance()->getProtocol(PROTOCOL_START_GAME));
if (protocol)
protocol->ready();
} // startNextRace