From ef43b197d0fd3a366a6c6aac8ebd6ce60c1fe25a Mon Sep 17 00:00:00 2001 From: Agent X <44549182+AgentXLP@users.noreply.github.com> Date: Fri, 21 Jun 2024 17:33:32 -0400 Subject: [PATCH] Fix being able to join direct connection lobbies past max players --- src/pc/network/packets/packet_join.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pc/network/packets/packet_join.c b/src/pc/network/packets/packet_join.c index fefcf15f..7af60ead 100644 --- a/src/pc/network/packets/packet_join.c +++ b/src/pc/network/packets/packet_join.c @@ -80,6 +80,7 @@ void network_send_join(struct Packet* joinRequestPacket) { u8 globalIndex = joinRequestPacket->localIndex; if (globalIndex == UNKNOWN_LOCAL_INDEX) { for (u32 i = 1; i < MAX_PLAYERS; i++) { + if (i >= gServerSettings.maxPlayers) { break; } if (!gNetworkPlayers[i].connected) { globalIndex = i; break;