From 0e67812b8a87ec28effd40a8f0c3afe8d39cb72f Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Sat, 7 Jan 2012 19:34:10 +0100 Subject: [PATCH] csqcplayers: fix wrong input_buttons in a case that shouldn't ever happen --- qcsrc/csqcmodellib/cl_player.qc | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/qcsrc/csqcmodellib/cl_player.qc b/qcsrc/csqcmodellib/cl_player.qc index ec7fe0ddf1..e7e5d960a1 100644 --- a/qcsrc/csqcmodellib/cl_player.qc +++ b/qcsrc/csqcmodellib/cl_player.qc @@ -99,6 +99,8 @@ void CSQCPlayer_PredictTo(float endframe) csqcplayer_status = CSQCPLAYERSTATUS_PREDICTED; + // FIXME do we really NEED this? dead players have servercommandframe + // == 0 and thus won't predict if (getstatf(STAT_HEALTH) <= 0) { csqcplayer_moveframe = clientcommandframe; @@ -106,15 +108,21 @@ void CSQCPlayer_PredictTo(float endframe) return; } - while(csqcplayer_moveframe < endframe) + if(csqcplayer_moveframe >= endframe) { - if (!getinputstate(csqcplayer_moveframe)) + getinputstate(csqcplayer_moveframe - 1); + } + else + { + do { - break; + if (!getinputstate(csqcplayer_moveframe)) + break; + runstandardplayerphysics(self); + CSQCPlayer_SetMinsMaxs(); + csqcplayer_moveframe++; } - runstandardplayerphysics(self); - CSQCPlayer_SetMinsMaxs(); - csqcplayer_moveframe++; + while(csqcplayer_moveframe < endframe); } //add in anything that was applied after (for low packet rate protocols) -- 2.39.2