]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Clean up SpectateSet a little
authorMario <zacjardine@y7mail.com>
Sun, 30 Aug 2015 06:55:06 +0000 (16:55 +1000)
committerMario <zacjardine@y7mail.com>
Sun, 30 Aug 2015 06:55:06 +0000 (16:55 +1000)
qcsrc/server/cl_client.qc

index 1cf86007ed26fefdb6846f54178e2090a937b07b..6c92365f8fcab43f8ea6345b88005e016736e653 100644 (file)
@@ -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;
 }