From: cloudwalk Date: Wed, 17 Jun 2020 16:55:25 +0000 (+0000) Subject: Fix dumb mistake allowing cheats to be used despite sv_cheats being 0... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=bd626173ef806b1b1031135575c6f6b08811b149;p=xonotic%2Fdarkplaces.git Fix dumb mistake allowing cheats to be used despite sv_cheats being 0... git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12688 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cmd.c b/cmd.c index 2cb94d22..5fc5e579 100644 --- a/cmd.c +++ b/cmd.c @@ -2074,7 +2074,8 @@ void Cmd_ExecuteString (cmd_state_t *cmd, const char *text, cmd_source_t src, qb { if((func->flags & CMD_CHEAT) && !sv_cheats.integer) SV_ClientPrintf("No cheats allowed. The server must have sv_cheats set to 1\n"); - func->function(cmd); + else + func->function(cmd); goto done; } } diff --git a/host_cmd.c b/host_cmd.c index d9e2c541..188ad7af 100644 --- a/host_cmd.c +++ b/host_cmd.c @@ -3054,11 +3054,11 @@ void Host_InitCommands (void) Cmd_AddCommand(CMD_SERVER_FROM_CLIENT, "begin", Host_Begin_f, "internal use - signon 3 (client asks server to start sending entities, and will go to signon 4 (playing) when the first entity update is received)"); Cmd_AddCommand(CMD_SERVER_FROM_CLIENT, "pings", Host_Pings_f, "internal use - command sent by clients to request updated ping and packetloss of players on scoreboard (originally from QW, but also used on NQ servers)"); - Cmd_AddCommand(CMD_SERVER_FROM_CLIENT, "god", Host_God_f, "god mode (invulnerability)"); - Cmd_AddCommand(CMD_SERVER_FROM_CLIENT, "notarget", Host_Notarget_f, "notarget mode (monsters do not see you)"); - Cmd_AddCommand(CMD_SERVER_FROM_CLIENT, "fly", Host_Fly_f, "fly mode (flight)"); - Cmd_AddCommand(CMD_SERVER_FROM_CLIENT, "noclip", Host_Noclip_f, "noclip mode (flight without collisions, move through walls)"); - Cmd_AddCommand(CMD_SERVER_FROM_CLIENT, "give", Host_Give_f, "alter inventory"); + Cmd_AddCommand(CMD_CHEAT | CMD_SERVER_FROM_CLIENT, "god", Host_God_f, "god mode (invulnerability)"); + Cmd_AddCommand(CMD_CHEAT | CMD_SERVER_FROM_CLIENT, "notarget", Host_Notarget_f, "notarget mode (monsters do not see you)"); + Cmd_AddCommand(CMD_CHEAT | CMD_SERVER_FROM_CLIENT, "fly", Host_Fly_f, "fly mode (flight)"); + Cmd_AddCommand(CMD_CHEAT | CMD_SERVER_FROM_CLIENT, "noclip", Host_Noclip_f, "noclip mode (flight without collisions, move through walls)"); + Cmd_AddCommand(CMD_CHEAT | CMD_SERVER_FROM_CLIENT, "give", Host_Give_f, "alter inventory"); Cmd_AddCommand(CMD_SERVER_FROM_CLIENT, "kill", Host_Kill_f, "die instantly"); Cmd_AddCommand(CMD_CLIENT | CMD_SERVER_FROM_CLIENT, "name", Host_Name_f, "change your player name"); Cmd_AddCommand(CMD_CLIENT | CMD_SERVER_FROM_CLIENT, "color", Host_Color_f, "change your player shirt and pants colors");