From 74156e70eb9d0c79b648cca990f5181d31779556 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Mon, 14 Nov 2011 10:15:40 +0100 Subject: [PATCH] properly support toggling csqcplayer status --- qcsrc/csqcmodel/cl_player.qc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/qcsrc/csqcmodel/cl_player.qc b/qcsrc/csqcmodel/cl_player.qc index 31df6b7b1..ba93c2e8d 100644 --- a/qcsrc/csqcmodel/cl_player.qc +++ b/qcsrc/csqcmodel/cl_player.qc @@ -137,7 +137,7 @@ void CSQCPlayer_SetCamera() self = oldself; - org = csqcplayer.origin + '0 0 1' * getstatf(STAT_VIEWHEIGHT) + CSQCPlayer_GetPredictionError(); + org = csqcplayer.origin + '0 0 1' * getstati(STAT_VIEWHEIGHT) + CSQCPlayer_GetPredictionError(); ang = R_SetView3fv(VF_ANGLES); // simulate missing engine features @@ -157,11 +157,19 @@ void CSQCPlayer_SetCamera() } } +void CSQCPlayer_Remove() +{ + if(self.entnum != player_localentnum) + return; + csqcplayer = world; + cvar_clientsettemp("cl_movement_replay", "0"); +} + float CSQCPlayer_PreUpdate() { if(self.entnum != player_localentnum) return 0; - cvar_clientsettemp("cl_movement_replay", "0"); + cvar_clientsettemp("cl_movement_replay", "1"); if(csqcplayer_status != CSQCPLAYERSTATUS_FROMSERVER) CSQCPlayer_Unpredict(); return 1; @@ -177,6 +185,7 @@ float CSQCPlayer_PostUpdate() return 0; csqcplayer_status = CSQCPLAYERSTATUS_FROMSERVER; csqcplayer = self; + self.entremove = CSQCPlayer_Remove; return 1; } -- 2.39.2