]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
fix some issues with spectating
authorRudolf Polzer <divverent@xonotic.org>
Tue, 27 Dec 2011 09:51:53 +0000 (10:51 +0100)
committerRudolf Polzer <divverent@xonotic.org>
Tue, 27 Dec 2011 09:51:53 +0000 (10:51 +0100)
qcsrc/csqcmodellib/cl_player.qc

index d1cfa4060093f25eac80c0e17c45766f98530166..8eaa5c3c8bfba2a42af183943af1341224a9148c 100644 (file)
@@ -209,6 +209,15 @@ void CSQCPlayer_SetCamera()
        view = CSQCModel_server2csqc(player_localentnum);
 #endif
 
+       if(view != csqcplayer)
+       {
+               entity oldself = self;
+               self = view;
+               InterpolateOrigin_Do();
+               self.view_ofs = '0 0 1' * getstati(STAT_VIEWHEIGHT);
+               self = oldself;
+       }
+
 #ifdef COMPAT_XON050_ENGINE
        if(view && !(checkextension("DP_CSQC_V_CALCREFDEF") || checkextension("DP_CSQC_V_CALCREFDEF_WIP1")))
        {
@@ -241,17 +250,14 @@ void CSQCPlayer_SetCamera()
 
 void CSQCPlayer_Remove()
 {
-       if(self.entnum != player_localnum + 1)
-               return;
        csqcplayer = world;
        cvar_clientsettemp("cl_movement_replay", "1");
 }
 
 float CSQCPlayer_PreUpdate()
 {
-       if(self.entnum != player_localnum + 1)
+       if(self != csqcplayer)
                return 0;
-       cvar_clientsettemp("cl_movement_replay", "0");
        if(csqcplayer_status != CSQCPLAYERSTATUS_FROMSERVER)
                CSQCPlayer_Unpredict();
        return 1;
@@ -259,10 +265,11 @@ float CSQCPlayer_PreUpdate()
 
 float CSQCPlayer_PostUpdate()
 {
-       if(self.entnum != player_localentnum)
+       if(self.entnum != player_localnum + 1)
                return 0;
-       csqcplayer_status = CSQCPLAYERSTATUS_FROMSERVER;
        csqcplayer = self;
+       csqcplayer_status = CSQCPLAYERSTATUS_FROMSERVER;
+       cvar_clientsettemp("cl_movement_replay", "0");
        self.entremove = CSQCPlayer_Remove;
        return 1;
 }