From: Mario Date: Sun, 30 Aug 2015 06:55:06 +0000 (+1000) Subject: Clean up SpectateSet a little X-Git-Tag: xonotic-v0.8.2~1975 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=306bf371bd156d6d42a038a09438640437f80705;p=xonotic%2Fxonotic-data.pk3dir.git Clean up SpectateSet a little --- 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; }