From 50f1b035b89ab8c4559620e12ab55cf7458fc291 Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Tue, 21 Jan 2020 20:46:32 +0100 Subject: Fix MultiplayerAPI crash when peer impl misbehave. Also fix WebSocketMultiplayer::get_available_packet_count() return value when peer is not configured to use the multiplayer API. --- core/io/multiplayer_api.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'core/io/multiplayer_api.cpp') 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; -- cgit v1.2.3