From 93ffc209bc4be8b3a3e683b5bd03d2cf71f94d41 Mon Sep 17 00:00:00 2001 From: staphen Date: Mon, 17 Nov 2025 21:00:37 -0500 Subject: [PATCH] Fix some bugs during the ZT handshake process --- Source/dvlnet/base_protocol.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/dvlnet/base_protocol.h b/Source/dvlnet/base_protocol.h index f4365683f..9d1685174 100644 --- a/Source/dvlnet/base_protocol.h +++ b/Source/dvlnet/base_protocol.h @@ -241,7 +241,7 @@ tl::expected base_protocol

::InitiateHandshake(plr_t player // It will cause problems if both peers attempt to initiate the handshake simultaneously. // If the connection is already open, it should be safe to initiate from either end. // If not, only the player with the smaller player number should initiate the handshake. - if (plr_self < player || proto.is_peer_connected(peer.endpoint)) + if (peer.endpoint && (plr_self < player || proto.is_peer_connected(peer.endpoint))) return SendEchoRequest(player); return {}; @@ -261,7 +261,7 @@ tl::expected base_protocol

::send(packet &pkt) } if (destination >= MAX_PLRS) return tl::make_unexpected("Invalid player ID"); - if (destination == MyPlayerId) + if (destination == plr_self) return {}; return SendTo(destination, pkt); }