Move validation checking to sendPacketToAllPeersWith
This commit is contained in:
@@ -604,8 +604,6 @@ void ServerLobby::handleChat(Event* event)
|
||||
STKHost::get()->sendPacketToAllPeersWith(
|
||||
[game_started, sender_in_game](STKPeer* p)
|
||||
{
|
||||
if (!p->isValidated())
|
||||
return false;
|
||||
if (game_started)
|
||||
{
|
||||
if (p->isWaitingForGame() && !sender_in_game)
|
||||
|
||||
@@ -1269,6 +1269,8 @@ void STKHost::sendPacketToAllPeersWith(std::function<bool(STKPeer*)> predicate,
|
||||
for (auto p : m_peers)
|
||||
{
|
||||
STKPeer* stk_peer = p.second.get();
|
||||
if (!stk_peer->isValidated())
|
||||
continue;
|
||||
if (predicate(stk_peer))
|
||||
stk_peer->sendPacket(data, reliable);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user