From: Rudolf Polzer Date: Tue, 27 Dec 2011 09:51:53 +0000 (+0100) Subject: fix some issues with spectating X-Git-Tag: xonotic-v0.6.0~74^2~46 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=29bbefdbb485a916a2889258c823670f01876015;p=xonotic%2Fxonotic-data.pk3dir.git fix some issues with spectating --- diff --git a/qcsrc/csqcmodellib/cl_player.qc b/qcsrc/csqcmodellib/cl_player.qc index d1cfa4060..8eaa5c3c8 100644 --- a/qcsrc/csqcmodellib/cl_player.qc +++ b/qcsrc/csqcmodellib/cl_player.qc @@ -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; }