mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-21 19:45:10 +00:00
Fix max player count limit code I did a couple hours ago
This commit is contained in:
parent
570afe946e
commit
c790922805
1 changed files with 4 additions and 2 deletions
|
@ -78,15 +78,17 @@ void network_send_join(struct Packet* joinRequestPacket) {
|
|||
|
||||
// figure out id
|
||||
u8 globalIndex = joinRequestPacket->localIndex;
|
||||
u8 connectedCount = 1;
|
||||
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;
|
||||
} else {
|
||||
connectedCount++;
|
||||
}
|
||||
}
|
||||
if (globalIndex == UNKNOWN_LOCAL_INDEX) {
|
||||
if (globalIndex == UNKNOWN_LOCAL_INDEX || connectedCount >= gServerSettings.maxPlayers) {
|
||||
network_send_kick(0, EKT_FULL_PARTY);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue