From: Rudolf Polzer Date: Sat, 7 Jan 2012 18:34:10 +0000 (+0100) Subject: csqcplayers: fix wrong input_buttons in a case that shouldn't ever happen X-Git-Tag: xonotic-v0.6.0~188^2~16^2~4 X-Git-Url: http://de.git.xonotic.org/?a=commitdiff_plain;h=0e67812b8a87ec28effd40a8f0c3afe8d39cb72f;p=xonotic%2Fxonotic-data.pk3dir.git csqcplayers: fix wrong input_buttons in a case that shouldn't ever happen --- diff --git a/qcsrc/csqcmodellib/cl_player.qc b/qcsrc/csqcmodellib/cl_player.qc index ec7fe0ddf..e7e5d960a 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)