Update d_clisrv.c

This commit is contained in:
Shane Ellis 2021-01-15 17:55:14 -05:00
parent 93562b782e
commit 9bbebcbe9e

View file

@ -2815,18 +2815,22 @@ static void Command_Kick(void)
return; return;
} }
if (!netgame) // Don't kick Tails in splitscreen!
{
CONS_Printf(M_GetText("This only works in a netgame.\n"));
return;
}
if (server || IsPlayerAdmin(consoleplayer)) if (server || IsPlayerAdmin(consoleplayer))
{ {
UINT8 buf[3 + MAX_REASONLENGTH]; UINT8 buf[3 + MAX_REASONLENGTH];
UINT8 *p = buf; UINT8 *p = buf;
const SINT8 pn = nametonum(COM_Argv(1)); const SINT8 pn = nametonum(COM_Argv(1));
// Unlike bans, kicks are used especially to remove bot players, so we'll
// need to run a more specific check which allows kicking offline, but
// not against splitscreen players.
if (splitscreen && (pn == 0 || pn == 1))
{
CONS_Printf(M_GetText("Splitscreen players cannot be kicked.\n"));
return;
}
if (pn == -1 || pn == 0) if (pn == -1 || pn == 0)
return; return;