summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--network_data.c2
-rw-r--r--network_udp.c8
2 files changed, 7 insertions, 3 deletions
diff --git a/network_data.c b/network_data.c
index ce008a86a..43ed7c769 100644
--- a/network_data.c
+++ b/network_data.c
@@ -125,7 +125,7 @@ static NetworkRecvStatus CloseConnection(NetworkClientState *cs)
NetworkCloseClient(cs);
// Clients drop back to the main menu
- if (!_network_server) {
+ if (!_network_server && _networking) {
_switch_mode = SM_MENU;
_networking = false;
_switch_mode_errorstr = STR_NETWORK_ERR_LOSTCONNECTION;
diff --git a/network_udp.c b/network_udp.c
index 7fed91b10..5ee2bb6ea 100644
--- a/network_udp.c
+++ b/network_udp.c
@@ -328,8 +328,12 @@ static void NetworkHandleUDPPacket(Packet* p, struct sockaddr_in* client_addr)
if (type < PACKET_UDP_END && _network_udp_packet[type] != NULL && !_udp_cs.quited) {
_network_udp_packet[type](p, client_addr);
- } else {
- DEBUG(net, 0)("[NET][UDP] Received invalid packet type %d", type);
+ } else {
+ if (!_udp_cs.quited) {
+ DEBUG(net, 0)("[NET][UDP] Received invalid packet type %d", type);
+ } else {
+ DEBUG(net, 0)("[NET][UDP] Received illegal packet");
+ }
}
}