]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
fix observing and most of spectating
authorRudolf Polzer <divverent@xonotic.org>
Tue, 15 Nov 2011 10:36:50 +0000 (11:36 +0100)
committerRudolf Polzer <divverent@xonotic.org>
Tue, 15 Nov 2011 10:36:50 +0000 (11:36 +0100)
qcsrc/csqcmodel/cl_player.qc
qcsrc/server/cl_client.qc

index 5d356a053ce2014083849b9f706d532b5a9ba281..bfa8616f60670ba135a1f40a6b975ffcc4633a90 100644 (file)
@@ -153,6 +153,11 @@ void CSQCPlayer_SetCamera()
                                self.pmove_flags |= PMF_ONGROUND;
                        else
                                self.pmove_flags &~= PMF_ONGROUND;
+
+                       CSQCPlayer_SetMinsMaxs();
+
+                       self.view_ofs_z = getstati(STAT_VIEWHEIGHT);
+                       print(vtos(self.view_ofs), "\n");
                }
                else
                {
@@ -182,9 +187,9 @@ void CSQCPlayer_SetCamera()
                                CSQCPlayer_SavePrediction();
                        }
                        CSQCPlayer_PredictTo(clientcommandframe);
-               }
 
-               CSQCPlayer_SetMinsMaxs();
+                       CSQCPlayer_SetMinsMaxs();
+               }
 
                // relink
                setorigin(self, self.origin);
index cd18bc6191a90b5b4524f68be2e55508f0fcc8d4..cd5bc3b65687c54f58896408d64aacdb4cef8b0c 100644 (file)
@@ -570,16 +570,18 @@ void PutObserverInServer (void)
        self.fixangle = TRUE;
        self.crouch = FALSE;
 
-       self.view_ofs = '0 0 0'; // so that your view doesn't go into the ceiling with MOVETYPE_FLY_WORLDONLY, previously "PL_VIEW_OFS"
        setorigin (self, spot.origin);
-       setsize (self, PL_CROUCH_MIN, PL_CROUCH_MAX); // give the spectator some space between walls for MOVETYPE_FLY_WORLDONLY
        self.prevorigin = self.origin;
        self.items = 0;
        self.weapons = 0;
        self.model = "";
        FixPlayermodel();
-       self.model = "";
-       self.modelindex = 0;
+       setmodel(self, "null");
+       self.drawonlytoclient = self;
+
+       setsize (self, PL_CROUCH_MIN, PL_CROUCH_MAX); // give the spectator some space between walls for MOVETYPE_FLY_WORLDONLY
+       self.view_ofs = '0 0 0'; // so that your view doesn't go into the ceiling with MOVETYPE_FLY_WORLDONLY, previously "PL_VIEW_OFS"
+
        self.weapon = 0;
        self.weaponname = "";
        self.switchingweapon = 0;
@@ -894,6 +896,7 @@ void PutClientInServer (void)
 
                self.model = "";
                FixPlayermodel();
+               self.drawonlytoclient = world;
 
                self.crouch = FALSE;
                self.view_ofs = PL_VIEW_OFS;