aboutsummaryrefslogtreecommitdiff
path: root/src/network/connection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/connection.cpp')
-rw-r--r--src/network/connection.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/network/connection.cpp b/src/network/connection.cpp
index 3692e45a9..0ba8c36b2 100644
--- a/src/network/connection.cpp
+++ b/src/network/connection.cpp
@@ -1269,7 +1269,8 @@ bool Connection::deletePeer(session_t peer_id, bool timeout)
return false;
peer = m_peers[peer_id];
m_peers.erase(peer_id);
- m_peer_ids.remove(peer_id);
+ auto it = std::find(m_peer_ids.begin(), m_peer_ids.end(), peer_id);
+ m_peer_ids.erase(it);
}
Address peer_address;
@@ -1565,7 +1566,7 @@ void Connection::sendAck(session_t peer_id, u8 channelnum, u16 seqnum)
UDPPeer* Connection::createServerPeer(Address& address)
{
- if (getPeerNoEx(PEER_ID_SERVER) != 0)
+ if (ConnectedToServer())
{
throw ConnectionException("Already connected to a server");
}