]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Print different message for invalid sv->cl cmd. Improve consistency overall
authorcloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 20 May 2020 15:22:07 +0000 (15:22 +0000)
committercloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 20 May 2020 15:22:07 +0000 (15:22 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12546 d7cf8633-e32d-0410-b094-e92efae38249

cmd.c

diff --git a/cmd.c b/cmd.c
index ad1097616162745c0e8e43f6cdc33a34054706e5..74f7eaff7674c2f3693298ce4f973295439f94eb 100644 (file)
--- a/cmd.c
+++ b/cmd.c
@@ -2050,7 +2050,7 @@ void Cmd_ExecuteString (cmd_state_t *cmd, const char *text, cmd_source_t src, qb
        // if it's a client command and no command was found, say so.
        if (cmd->source == src_client)
        {
-               Con_Printf("player \"%s\" tried to %s\n", host_client->name, text);
+               Con_Printf("Client \"%s\" tried to execute \"%s\"\n", host_client->name, text);
                goto done;
        }
 
@@ -2065,9 +2065,13 @@ void Cmd_ExecuteString (cmd_state_t *cmd, const char *text, cmd_source_t src, qb
        }
 
 // check cvars
-       if (!Cvar_Command(cmd) && host_framecount > 0)
-               Con_Printf("Unknown command \"%s\"\n", Cmd_Argv(cmd, 0));
-
+       if (!Cvar_Command(cmd) && host_framecount > 0) {
+               if (cmd == &cmd_clientfromserver) {
+                       Con_Printf("Server tried to execute \"%s\"\n", Cmd_Argv(cmd, 0));
+               } else {
+                       Con_Printf("Unknown command \"%s\"\n", Cmd_Argv(cmd, 0));
+               }
+       }
 done:
        cmd->tokenizebufferpos = oldpos;
        if (lockmutex)