From 30ab4a9fd884625a23239d86761b9fe489f9cac5 Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 28 Jun 2016 07:21:41 +1000 Subject: [PATCH] Fix up the Spectate mutator hooks for CA --- qcsrc/server/cl_client.qc | 1 - qcsrc/server/mutators/mutator/gamemode_ca.qc | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index 733b09355..f2f0f4a35 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -1735,7 +1735,6 @@ bool SpectatePrev(entity this) ent = M_ARGV(1, entity); break; case MUT_SPECPREV_RETURN: - ent = M_ARGV(1, entity); return true; case MUT_SPECPREV_CONTINUE: default: diff --git a/qcsrc/server/mutators/mutator/gamemode_ca.qc b/qcsrc/server/mutators/mutator/gamemode_ca.qc index 2a8da29c2..a581d0fa8 100644 --- a/qcsrc/server/mutators/mutator/gamemode_ca.qc +++ b/qcsrc/server/mutators/mutator/gamemode_ca.qc @@ -439,11 +439,11 @@ MUTATOR_HOOKFUNCTION(ca, SpectateSet) MUTATOR_HOOKFUNCTION(ca, SpectateNext) { entity client = M_ARGV(0, entity); - entity targ = M_ARGV(1, entity); if (!autocvar_g_ca_spectate_enemies && client.caplayer) { - targ = CA_SpectateNext(client, targ); + entity targ = M_ARGV(1, entity); + M_ARGV(1, entity) = CA_SpectateNext(client, targ); return true; } } @@ -468,6 +468,8 @@ MUTATOR_HOOKFUNCTION(ca, SpectatePrev) } } + M_ARGV(1, entity) = targ; + return MUT_SPECPREV_FOUND; } -- 2.39.2