]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
csqcplayers: fix wrong input_buttons in a case that shouldn't ever happen
authorRudolf Polzer <divverent@alientrap.org>
Sat, 7 Jan 2012 18:34:10 +0000 (19:34 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Sat, 7 Jan 2012 18:34:10 +0000 (19:34 +0100)
qcsrc/csqcmodellib/cl_player.qc

index ec7fe0ddf171d2700138aa327a029de89596a511..e7e5d960a16995ac4a39f0e98b2a5ebd1b796c84 100644 (file)
@@ -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)