]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/command/cmd.qc
Don't allow voice messages to function while spectating or observing
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / command / cmd.qc
index 444e86de332bc88b2e06438716dc1bebcf1b7fcf..6928957d6d812e6f15511d2b82e421d8f0c7f877 100644 (file)
@@ -355,7 +355,7 @@ void ClientCommand_physics(entity caller, int request, int argc)
 
                        if (Physics_Valid(command) || command == "default")
                        {
-                               stuffcmd(caller, strcat("\nseta cl_physics ", command, "\nsendcvar cl_physics\n"));
+                               stuffcmd(caller, strcat("\nseta cl_physics ", command, "\n"));
                                sprint(caller, strcat("^2Physics set successfully changed to ^3", command, "\n"));
                                return;
                        }
@@ -762,6 +762,18 @@ void ClientCommand_voice(entity caller, int request, int argc, string command)
                                        sprint(caller, sprintf("Invalid voice. Use one of: %s\n", allvoicesamples));
                                        return;
                                }
+                               if (IS_DEAD(caller))
+                               {
+                                       // don't warn the caller when trying to taunt while dead, just don't play any sounds!
+                                       // we still allow them to see warnings if it's invalid, so a dead player can find out the sounds in peace
+                                       return;
+                               }
+                               if (IS_SPEC(caller) || IS_OBSERVER(caller))
+                               {
+                                       // observers/spectators have no player model of their own to play taunts from
+                                       // again, allow them to see warnings
+                                       return;
+                               }
                                string msg = "";
                                if (argc >= 3)
                                        msg = substring(command, argv_start_index(2), argv_end_index(-1) - argv_start_index(2));
@@ -910,6 +922,7 @@ void SV_ParseClientCommand(entity this, string command)
                case "prespawn": break;                            // handled by engine in host_cmd.c
                case "sentcvar": break;                            // handled by server in this file
                case "spawn": break;                               // handled by engine in host_cmd.c
+               case "color": case "topcolor": case "bottomcolor": if(teamplay) return; else break; // handled by engine in host_cmd.c
                case "c2s": Net_ClientCommand(this, command); return; // handled by net.qh
 
                default: