diff options
-rw-r--r-- | core/io/multiplayer_api.cpp | 1 | ||||
-rw-r--r-- | modules/websocket/websocket_multiplayer_peer.cpp | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/core/io/multiplayer_api.cpp b/core/io/multiplayer_api.cpp index 2708cb8c01..381ac4c0bb 100644 --- a/core/io/multiplayer_api.cpp +++ b/core/io/multiplayer_api.cpp @@ -111,6 +111,7 @@ void MultiplayerAPI::poll() { Error err = network_peer->get_packet(&packet, len); if (err != OK) { ERR_PRINT("Error getting packet!"); + break; // Something is wrong! } rpc_sender_id = sender; diff --git a/modules/websocket/websocket_multiplayer_peer.cpp b/modules/websocket/websocket_multiplayer_peer.cpp index b639c635fd..27ea50b524 100644 --- a/modules/websocket/websocket_multiplayer_peer.cpp +++ b/modules/websocket/websocket_multiplayer_peer.cpp @@ -98,7 +98,7 @@ void WebSocketMultiplayerPeer::_bind_methods() { // int WebSocketMultiplayerPeer::get_available_packet_count() const { - ERR_FAIL_COND_V_MSG(!_is_multiplayer, ERR_UNCONFIGURED, "Please use get_peer(ID).get_available_packet_count to get available packet count from peers when not using the MultiplayerAPI."); + ERR_FAIL_COND_V_MSG(!_is_multiplayer, 0, "Please use get_peer(ID).get_available_packet_count to get available packet count from peers when not using the MultiplayerAPI."); return _incoming_packets.size(); } |