Don't allow voice messages to function while spectating or observing
authorMario <mario.mario@y7mail.com>
Sat, 28 Sep 2019 08:41:29 +0000 (18:41 +1000)
committerMario <mario.mario@y7mail.com>
Sat, 28 Sep 2019 08:41:29 +0000 (18:41 +1000)
qcsrc/server/command/cmd.qc

index 4606638..6928957 100644 (file)
@@ -768,6 +768,12 @@ void ClientCommand_voice(entity caller, int request, int argc, string command)
                                        // 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));