Fixed incorrect indices.

This commit is contained in:
hiker 2015-12-03 08:23:52 +11:00
parent ee7097af35
commit 4286f47a31
2 changed files with 4 additions and 4 deletions

View File

@ -795,10 +795,10 @@ void ClientLobbyRoomProtocol::playerTrackVote(Event* event)
return;
std::string track_name;
int N = data.decodeString(7, &track_name);
if (!isByteCorrect(event, N+8, 1))
if (!isByteCorrect(event, N+7, 1))
return;
m_setup->getRaceConfig()->setPlayerTrackVote(data[6], track_name,
data[N+9]);
data[N+8]);
} // playerTrackVote
//-----------------------------------------------------------------------------

View File

@ -678,10 +678,10 @@ void ServerLobbyRoomProtocol::playerTrackVote(Event* event)
return;
std::string track_name;
int N = data.decodeString(5, &track_name);
if (!isByteCorrect(event, N+6, 1))
if (!isByteCorrect(event, N+5, 1))
return;
uint8_t player_id = peer->getPlayerProfile()->getPlayerID();
m_setup->getRaceConfig()->setPlayerTrackVote(player_id, track_name, data[N+7]);
m_setup->getRaceConfig()->setPlayerTrackVote(player_id, track_name, data[N+6]);
// Send the vote to everybody (including the sender)
data.removeFront(5); // remove the token
NetworkString other(2+data.size());