mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-31 05:30:48 +00:00
Some more tweaks of my own:
*Add CONS_Printf messages for !netgame checks *Arg count is checked first regardless of netgame status for both kick and ban, < 2 is checked instead of == 1 just in case these weren't called from console for some stupid reason? *Moved Command_Kick's buffer vars to within the code that actually does kicking stuff
This commit is contained in:
parent
9a1e1180ff
commit
4752109233
1 changed files with 16 additions and 11 deletions
|
@ -2525,15 +2525,18 @@ static void Command_Nodes(void)
|
||||||
|
|
||||||
static void Command_Ban(void)
|
static void Command_Ban(void)
|
||||||
{
|
{
|
||||||
if (!netgame) // Don't kick Tails in splitscreen!
|
if (COM_Argc() < 2)
|
||||||
return;
|
|
||||||
|
|
||||||
if (COM_Argc() == 1)
|
|
||||||
{
|
{
|
||||||
CONS_Printf(M_GetText("Ban <playername/playernum> <reason>: ban and kick a player\n"));
|
CONS_Printf(M_GetText("Ban <playername/playernum> <reason>: ban and kick a player\n"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!netgame) // Don't kick Tails in splitscreen!
|
||||||
|
{
|
||||||
|
CONS_Printf(M_GetText("This only works in a netgame.\n"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (server || adminplayer == consoleplayer)
|
if (server || adminplayer == consoleplayer)
|
||||||
{
|
{
|
||||||
XBOXSTATIC UINT8 buf[3 + MAX_REASONLENGTH];
|
XBOXSTATIC UINT8 buf[3 + MAX_REASONLENGTH];
|
||||||
|
@ -2588,20 +2591,22 @@ static void Command_Ban(void)
|
||||||
|
|
||||||
static void Command_Kick(void)
|
static void Command_Kick(void)
|
||||||
{
|
{
|
||||||
XBOXSTATIC UINT8 buf[3 + MAX_REASONLENGTH];
|
if (COM_Argc() < 2)
|
||||||
UINT8 *p = buf;
|
|
||||||
|
|
||||||
if (!netgame) // Don't kick Tails in splitscreen!
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (COM_Argc() == 1)
|
|
||||||
{
|
{
|
||||||
CONS_Printf(M_GetText("kick <playername/playernum> <reason>: kick a player\n"));
|
CONS_Printf(M_GetText("kick <playername/playernum> <reason>: kick a player\n"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!netgame) // Don't kick Tails in splitscreen!
|
||||||
|
{
|
||||||
|
CONS_Printf(M_GetText("This only works in a netgame.\n"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (server || adminplayer == consoleplayer)
|
if (server || adminplayer == consoleplayer)
|
||||||
{
|
{
|
||||||
|
XBOXSTATIC UINT8 buf[3 + MAX_REASONLENGTH];
|
||||||
|
UINT8 *p = buf;
|
||||||
const SINT8 pn = nametonum(COM_Argv(1));
|
const SINT8 pn = nametonum(COM_Argv(1));
|
||||||
|
|
||||||
if (pn == -1 || pn == 0)
|
if (pn == -1 || pn == 0)
|
||||||
|
|
Loading…
Reference in a new issue