Skip to content

Commit

Permalink
Allow use of devmap globally, regardless of game. (#292)
Browse files Browse the repository at this point in the history
  • Loading branch information
eukara authored Oct 25, 2024
1 parent 8c71c41 commit b7cc45f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion engine/server/sv_ccmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -1073,6 +1075,10 @@ void SV_Map_f (void)
}
#endif

if (forceCheats) {
Cvar_ForceSet(&sv_cheats, "1");
}

#ifdef Q3SERVER
{
cvar_t *var, *gametype;
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit b7cc45f

Please sign in to comment.