Merge pull request #5108 from lioncash/shadow-vars

NetPlayClient: Eliminate variable shadowing
This commit is contained in:
Matthew Parlane 2017-03-19 16:41:03 +13:00 committed by GitHub
commit d108747371
1 changed files with 8 additions and 8 deletions

View File

@ -368,15 +368,15 @@ unsigned int NetPlayClient::OnData(sf::Packet& packet)
// update gui // update gui
m_dialog->OnMsgChangeGame(m_selected_game); m_dialog->OnMsgChangeGame(m_selected_game);
sf::Packet packet; sf::Packet game_status_packet;
packet << static_cast<MessageId>(NP_MSG_GAME_STATUS); game_status_packet << static_cast<MessageId>(NP_MSG_GAME_STATUS);
PlayerGameStatus status = m_dialog->FindGame(m_selected_game).empty() ? PlayerGameStatus status = m_dialog->FindGame(m_selected_game).empty() ?
PlayerGameStatus::NotFound : PlayerGameStatus::NotFound :
PlayerGameStatus::Ok; PlayerGameStatus::Ok;
packet << static_cast<u32>(status); game_status_packet << static_cast<u32>(status);
Send(packet); Send(game_status_packet);
} }
break; break;
@ -445,11 +445,11 @@ unsigned int NetPlayClient::OnData(sf::Packet& packet)
u32 ping_key = 0; u32 ping_key = 0;
packet >> ping_key; packet >> ping_key;
sf::Packet packet; sf::Packet response_packet;
packet << (MessageId)NP_MSG_PONG; response_packet << static_cast<MessageId>(NP_MSG_PONG);
packet << ping_key; response_packet << ping_key;
Send(packet); Send(response_packet);
} }
break; break;