]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Prevent sentcvar from falling back to default values if no arguments are provided...
authorMario <mario.mario@y7mail.com>
Fri, 25 Jun 2021 10:38:12 +0000 (20:38 +1000)
committerMario <mario.mario@y7mail.com>
Fri, 25 Jun 2021 10:38:12 +0000 (20:38 +1000)
qcsrc/server/command/cmd.qc

index dd96a9c90930a36a7d4304ecbe6c49e71c60488b..a8a8747e1822558f0b3c572b58a5d105b7d4c773 100644 (file)
@@ -560,22 +560,22 @@ void ClientCommand_selfstuff(entity caller, int request, string command)
        }
 }
 
-void ClientCommand_sentcvar(entity caller, int request, int argc, string command)
+void ClientCommand_sentcvar(entity caller, int request, int argc)
 {
        switch (request)
        {
                case CMD_REQUEST_COMMAND:
                {
-                       if (argv(1) != "")
+                       if (argc >= 3)
                        {
-                               // float tokens;
-                               string s;
-
+                       // NOTE: client-side settings do not exist on the server, this functionality has been deprecated
+                       #if 0
                                if (argc == 2)  // undefined cvar: use the default value on the server then
                                {
-                                       s = strcat(substring(command, argv_start_index(0), argv_end_index(1) - argv_start_index(0)), " \"", cvar_defstring(argv(1)), "\"");
+                                       string s = strcat(substring(command, argv_start_index(0), argv_end_index(1) - argv_start_index(0)), " \"", cvar_defstring(argv(1)), "\"");
                                        tokenize_console(s);
                                }
+                       #endif
 
                                GetCvars(caller, CS_CVAR(caller), 1);
 
@@ -587,7 +587,7 @@ void ClientCommand_sentcvar(entity caller, int request, int argc, string command
                        sprint(caller, sprintf("Incorrect parameters for ^2%s^7\n", argv(0)));
                case CMD_REQUEST_USAGE:
                {
-                       sprint(caller, "\nUsage:^3 cmd sentcvar <cvar>\n");
+                       sprint(caller, "\nUsage:^3 cmd sentcvar <cvar> <arguments>\n");
                        sprint(caller, "  Where <cvar> is the cvar plus arguments to send to the server.\n");
                        return;
                }
@@ -815,7 +815,7 @@ void ClientCommand_(entity caller, int request)
        CLIENT_COMMAND("say_team", ClientCommand_say_team(ent, request, arguments, command), "Print a message to chat to all team mates") \
        CLIENT_COMMAND("selectteam", ClientCommand_selectteam(ent, request, arguments), "Attempt to choose a team to join into") \
        CLIENT_COMMAND("selfstuff", ClientCommand_selfstuff(ent, request, command), "Stuffcmd a command to your own client") \
-       CLIENT_COMMAND("sentcvar", ClientCommand_sentcvar(ent, request, arguments, command), "New system for sending a client cvar to the server") \
+       CLIENT_COMMAND("sentcvar", ClientCommand_sentcvar(ent, request, arguments), "New system for sending a client cvar to the server") \
        CLIENT_COMMAND("spectate", ClientCommand_spectate(ent, request), "Become an observer") \
        CLIENT_COMMAND("suggestmap", ClientCommand_suggestmap(ent, request, arguments), "Suggest a map to the mapvote at match end") \
        CLIENT_COMMAND("tell", ClientCommand_tell(ent, request, arguments, command), "Send a message directly to a player") \