From: bones_was_here Date: Wed, 30 Apr 2025 14:06:05 +0000 (+1000) Subject: spec command: catch mutator blocking of player argument X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f56cfea6bbdef69e67d96002a67790190c92ccd6;p=xonotic%2Fxonotic-data.pk3dir.git spec command: catch mutator blocking of player argument Returns the error instead of failing silently by spectating a different player. --- diff --git a/qcsrc/server/command/cmd.qc b/qcsrc/server/command/cmd.qc index 1663fe17bd..5c22952edc 100644 --- a/qcsrc/server/command/cmd.qc +++ b/qcsrc/server/command/cmd.qc @@ -765,12 +765,11 @@ void ClientCommand_spectate(entity caller, int request) else { entity client = GetFilteredEntity(argv(1)); - float spec_accepted = VerifyClientEntity(client, false, false); - if(spec_accepted > 0 && IS_PLAYER(client)) + if (IS_PLAYER(client) + && VerifyClientEntity(client, false, false) + && Spectate(caller, client)) // mutator hook might say no { - bool caller_is_observer = (IS_OBSERVER(caller)); - Spectate(caller, client); - if (caller_is_observer) + if (IS_OBSERVER(caller)) TRANSMUTE(Spectator, caller); } else