]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
try fixing issues with length of move
authorRudolf Polzer <divverent@alientrap.org>
Tue, 20 Dec 2011 16:49:13 +0000 (17:49 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Tue, 20 Dec 2011 16:49:13 +0000 (17:49 +0100)
qcsrc/csqcmodel/cl_player.qc

index 4a7cf2e1003e8ed57cebea08230d36a853748455..c2e366c9de1504df5275d28f6e47e1cd5512e33f 100644 (file)
@@ -25,6 +25,7 @@ var float autocvar_cl_predictionerrorcompensation = 0;
 // engine stuff
 .float pmove_flags;
 float pmove_onground; // weird engine flag we shouldn't really use but have to for now
+#define PMF_JUMP_HELD 1
 #define PMF_DUCKED 4
 #define PMF_ONGROUND 8
 #define REFDEFFLAG_TELEPORTED 1
@@ -111,8 +112,27 @@ void CSQCPlayer_PredictTo(float endframe)
                {
                        break;
                }
-               runstandardplayerphysics(self);
-               CSQCPlayer_SetMinsMaxs();
+               if(input_timelength <= 0.0005) // too short move
+               {
+                       dprint("CSQC physics hack: too short frame skipped\n");
+                       // even if not running physics, handle releasing the jump key
+                       if(!(input_buttons & 4))
+                               self.pmove_flags &~= PMF_JUMP_HELD;
+               }
+               else if(input_timelength > 0.05) // too long move
+               {
+                       dprint("CSQC physics hack: too long frame split in two\n");
+                       input_timelength *= 0.5;
+                       runstandardplayerphysics(self);
+                       CSQCPlayer_SetMinsMaxs();
+                       runstandardplayerphysics(self);
+                       CSQCPlayer_SetMinsMaxs();
+               }
+               else
+               {
+                       runstandardplayerphysics(self);
+                       CSQCPlayer_SetMinsMaxs();
+               }
                csqcplayer_moveframe++;
        }