Make the Cheats Command Reflect UsedCheats

This commit is contained in:
SMS Alfredo 2023-09-19 18:10:51 -05:00
parent 6deaf89f72
commit 7da8e2e776

View file

@ -4615,15 +4615,28 @@ static void Command_Cheats_f(void)
CV_ResetCheatNetVars(); CV_ResetCheatNetVars();
return; return;
} }
else if (COM_CheckParm("on"))
{
if (!(server || (IsPlayerAdmin(consoleplayer))))
CONS_Printf(M_GetText("Only the server or a remote admin can use this.\n"));
else
G_SetUsedCheats(false);
return;
}
if (usedCheats)
CONS_Printf(M_GetText("Cheats are enabled, the game cannot be saved.\n"));
else
CONS_Printf(M_GetText("Cheats are disabled, the game can be saved.\n"));
if (CV_CheatsEnabled()) if (CV_CheatsEnabled())
{ {
CONS_Printf(M_GetText("At least one CHEAT-marked variable has been changed -- Cheats are enabled.\n")); CONS_Printf(M_GetText("At least one CHEAT-marked variable has been changed.\n"));
if (server || (IsPlayerAdmin(consoleplayer))) if (server || (IsPlayerAdmin(consoleplayer)))
CONS_Printf(M_GetText("Type CHEATS OFF to reset all cheat variables to default.\n")); CONS_Printf(M_GetText("Type CHEATS OFF to reset all cheat variables to default.\n"));
} }
else else
CONS_Printf(M_GetText("No CHEAT-marked variables are changed -- Cheats are disabled.\n")); CONS_Printf(M_GetText("No CHEAT-marked variables are changed.\n"));
} }
#ifdef _DEBUG #ifdef _DEBUG