invite, leaveparty commands: use party API to check party size

Use G_PartySize/G_LocalSplitscreenPartySize instead of
r_splitscreen/splitscreen. This should be less
error-prone in case r_splitscreen fails to be updated
somehow.
This commit is contained in:
James R 2024-02-01 02:49:40 -08:00
parent ebbe8203a2
commit 6f27714011

View file

@ -1854,7 +1854,7 @@ Command_Invite_f (void)
return;
}
if (r_splitscreen >= MAXSPLITSCREENPLAYERS)
if (G_PartySize(consoleplayer) >= MAXSPLITSCREENPLAYERS)
{
CONS_Alert(CONS_WARNING, "Your party is full!\n");
return;
@ -1981,7 +1981,7 @@ Command_RejectInvite_f (void)
static void
Command_LeaveParty_f (void)
{
if (r_splitscreen > splitscreen)
if (G_PartySize(consoleplayer) > G_LocalSplitscreenPartySize(consoleplayer))
{
CONS_Printf("\x85Leaving party...\n");