Browse Source

[Net] Fix ENetMultiplayerPeer status during connection.

While the client emitting "peer_connect" for the server, the status was
still set to CONNECTION_CONNECTING, causing bugs in the upper layer.
Fabio Alessandrelli 4 years ago
parent
commit
a816d74fdf
1 changed files with 1 additions and 1 deletions
  1. 1 1
      modules/enet/enet_multiplayer_peer.cpp

+ 1 - 1
modules/enet/enet_multiplayer_peer.cpp

@@ -242,8 +242,8 @@ bool ENetMultiplayerPeer::_poll_client() {
 	}
 	}
 	switch (ret) {
 	switch (ret) {
 		case ENetConnection::EVENT_CONNECT: {
 		case ENetConnection::EVENT_CONNECT: {
-			emit_signal(SNAME("peer_connected"), 1);
 			connection_status = CONNECTION_CONNECTED;
 			connection_status = CONNECTION_CONNECTED;
+			emit_signal(SNAME("peer_connected"), 1);
 			emit_signal(SNAME("connection_succeeded"));
 			emit_signal(SNAME("connection_succeeded"));
 			return false;
 			return false;
 		}
 		}