From e1892bc4fd358e802fa7fd28b5a55174ab0f37bc Mon Sep 17 00:00:00 2001 From: hiker Date: Wed, 2 Mar 2016 16:58:41 +1100 Subject: [PATCH] Try to fix handling a kart finishing the race. --- src/network/protocols/game_events_protocol.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/network/protocols/game_events_protocol.cpp b/src/network/protocols/game_events_protocol.cpp index 981290704..1d23ec00d 100644 --- a/src/network/protocols/game_events_protocol.cpp +++ b/src/network/protocols/game_events_protocol.cpp @@ -135,17 +135,10 @@ void GameEventsProtocol::kartFinishedRace(AbstractKart *kart, float time) { NetworkString *ns = getNetworkString(20); ns->setSynchronous(true); - const std::vector &peers = STKHost::get()->getPeers(); - - // FIXME - TODO THIS APPEARS COMPLETELY BROKEN!!! - for (unsigned int i = 0; i < peers.size(); i++) - { - ns->addUInt32(peers[i]->getClientServerToken()) - .addUInt8(GE_KART_FINISHED_RACE) - .addUInt8(kart->getWorldKartId()).addFloat(time); - peers[i]->sendPacket(ns, /*reliable*/true); - delete ns; - } // for i in peers + ns->addUInt8(GE_KART_FINISHED_RACE).addUInt8(kart->getWorldKartId()) + .addFloat(time); + sendMessageToPeersChangingToken(ns, /*reliable*/true); + delete ns; } // kartFinishedRace // ----------------------------------------------------------------------------