mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Rework exitlevel conditions
- Uses K_CanChangeRules instead of checking for multiplayer, to catch all of the restricted singleplayer scenarios - Checks for server admin first before cheats
This commit is contained in:
parent
6f0b09fecd
commit
4ff0a8358f
1 changed files with 11 additions and 3 deletions
|
|
@ -5330,14 +5330,22 @@ static void Command_Mapmd5_f(void)
|
|||
|
||||
static void Command_ExitLevel_f(void)
|
||||
{
|
||||
if (!(netgame || multiplayer) && !CV_CheatsEnabled())
|
||||
CONS_Printf(M_GetText("This only works in a netgame.\n"));
|
||||
else if (!(server || (IsPlayerAdmin(consoleplayer))))
|
||||
if (!(server || (IsPlayerAdmin(consoleplayer))))
|
||||
{
|
||||
CONS_Printf(M_GetText("Only the server or a remote admin can use this.\n"));
|
||||
}
|
||||
else if (K_CanChangeRules(false) == false && CV_CheatsEnabled() == false)
|
||||
{
|
||||
CONS_Printf(M_GetText("This cannot be used without cheats enabled.\n"));
|
||||
}
|
||||
else if (( gamestate != GS_LEVEL && gamestate != GS_CREDITS ) || demo.playback)
|
||||
{
|
||||
CONS_Printf(M_GetText("You must be in a level to use this.\n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
SendNetXCmd(XD_EXITLEVEL, NULL, 0);
|
||||
}
|
||||
}
|
||||
|
||||
static void Got_ExitLevelcmd(UINT8 **cp, INT32 playernum)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue