From: TimePath Date: Tue, 27 Oct 2015 08:25:31 +0000 (+1100) Subject: Spectate: fix regression introduced by 74a4e5c X-Git-Tag: xonotic-v0.8.2~1778 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1da0a856a2c6ba9a576574bffe159ea23ed49e0e;p=xonotic%2Fxonotic-data.pk3dir.git Spectate: fix regression introduced by 74a4e5c --- diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index eb3dfc44e..d6522285b 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -1780,10 +1780,9 @@ bool SpectateNext() {SELFPARAM(); other = find(self.enemy, classname, "player"); - bool mutator_returnvalue = MUTATOR_CALLHOOK(SpectateNext, self, other); - other = spec_player; - - if(!mutator_returnvalue && !other) + if (MUTATOR_CALLHOOK(SpectateNext, self, other)) + other = spec_player; + else if (!other) other = find(other, classname, "player"); if(other) { SetSpectatee(self, other); } @@ -1804,13 +1803,14 @@ bool SpectatePrev() while(other && other != self.enemy) other = other.chain; - int mutator_returnvalue = MUTATOR_CALLHOOK(SpectatePrev, self, other, first); - other = spec_player; - - switch(mutator_returnvalue) + switch (MUTATOR_CALLHOOK(SpectatePrev, self, other, first)) { - case MUT_SPECPREV_FOUND: break; - case MUT_SPECPREV_RETURN: return true; + case MUT_SPECPREV_FOUND: + other = spec_player; + break; + case MUT_SPECPREV_RETURN: + other = spec_player; + return true; case MUT_SPECPREV_CONTINUE: default: {