From b7cc45f091236a730fbd09f5d100e08791ee1b73 Mon Sep 17 00:00:00 2001 From: eukara Date: Fri, 25 Oct 2024 02:03:46 -0700 Subject: [PATCH] Allow use of `devmap` globally, regardless of game. (#292) --- engine/server/sv_ccmds.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/engine/server/sv_ccmds.c b/engine/server/sv_ccmds.c index 7faf6ee21..914d6acc6 100644 --- a/engine/server/sv_ccmds.c +++ b/engine/server/sv_ccmds.c @@ -743,6 +743,7 @@ void SV_Map_f (void) #endif qboolean waschangelevel = false; qboolean mapeditor = false; + qboolean forceCheats = false; int i; char *startspot; const char *cmd = Cmd_Argv(0); @@ -840,6 +841,7 @@ void SV_Map_f (void) q2savetos0 = !strcmp(cmd, "gamemap") && !isDedicated; //q2 #endif mapeditor = !strcmp(Cmd_Argv(0), "mapedit"); + forceCheats = !strcmp(Cmd_Argv(0), "devmap"); sv.mapchangelocked = false; @@ -1073,6 +1075,10 @@ void SV_Map_f (void) } #endif + if (forceCheats) { + Cvar_ForceSet(&sv_cheats, "1"); + } + #ifdef Q3SERVER { cvar_t *var, *gametype; @@ -3587,8 +3593,8 @@ void SV_InitOperatorCommands (void) #ifdef Q3SERVER Cmd_AddCommandAD ("spmap", SV_Map_f, SV_Map_c, "Loads a map in single-player mode, for Quake III compat."); Cmd_AddCommandAD ("spdevmap", SV_Map_f, SV_Map_c, "Loads a map in single-player developer mode (sv_cheats 1), for Quake III compat."); - Cmd_AddCommandAD ("devmap", SV_Map_f, SV_Map_c, "Loads a map in developer mode (sv_cheats 1), for Quake III compat."); #endif + Cmd_AddCommandAD ("devmap", SV_Map_f, SV_Map_c, "Loads a map in developer mode (sv_cheats 1), for Quake III compat."); Cmd_AddCommandAD ("gamemap", SV_Map_f, SV_Map_c, NULL); Cmd_AddCommandAD ("changelevel", SV_Map_f, SV_Map_c, "Continues the game on a different map. The current map can be reentered later when a starting position for the new map is specified as a second argument."); Cmd_AddCommandD ("map_restart", SV_Map_f, "Restarts the server and reloads the map while flushing level cache, for general use and Quake III compat."); //from q3.