]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
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 4606638f621ac1240078f0149b2e27ef5cb17c78..6928957d6d812e6f15511d2b82e421d8f0c7f877 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));