From 306bf371bd156d6d42a038a09438640437f80705 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 30 Aug 2015 16:55:06 +1000 Subject: [PATCH] Clean up SpectateSet a little --- qcsrc/server/cl_client.qc | 39 +++++++++++++-------------------------- 1 file changed, 13 insertions(+), 26 deletions(-) diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index 1cf86007e..6c92365f8 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -1796,49 +1796,36 @@ void SpectateCopy(entity spectatee) { } } -float SpectateUpdate() +bool SpectateUpdate() { if(!self.enemy) - return 0; + return false; if(!IS_PLAYER(self.enemy) || self == self.enemy) { SetSpectator(self, world); - return 0; + return false; } SpectateCopy(self.enemy); - return 1; + return true; } -float SpectateSet() +bool SpectateSet() { - if(self.enemy.classname != "player") + if(!IS_PLAYER(self.enemy)) return false; - /*if(self.enemy.vehicle) - { - msg_entity = self; - WriteByte(MSG_ONE, SVC_SETVIEW); - WriteEntity(MSG_ONE, self.enemy); - //stuffcmd(self, "set viewsize $tmpviewsize \n"); + msg_entity = self; + WriteByte(MSG_ONE, SVC_SETVIEW); + WriteEntity(MSG_ONE, self.enemy); + self.movetype = MOVETYPE_NONE; + accuracy_resend(self); - self.movetype = MOVETYPE_NONE; - accuracy_resend(self); - } - else - {*/ - msg_entity = self; - WriteByte(MSG_ONE, SVC_SETVIEW); - WriteEntity(MSG_ONE, self.enemy); - //stuffcmd(self, "set viewsize $tmpviewsize \n"); - self.movetype = MOVETYPE_NONE; - accuracy_resend(self); + if(!SpectateUpdate()) + PutObserverInServer(); - if(!SpectateUpdate()) - PutObserverInServer(); - //} return true; } -- 2.39.2