]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Prevent players moving too far/fast when stepping up a staircase
authorbones_was_here <bones_was_here@xa.org.au>
Thu, 17 Mar 2022 18:17:46 +0000 (18:17 +0000)
committerbones_was_here <bones_was_here@xa.org.au>
Thu, 17 Mar 2022 18:17:46 +0000 (18:17 +0000)
.gitlab-ci.yml
qcsrc/common/physics/movetypes/movetypes.qc

index b5031c66ba00fd15d0976d0aed715b09e47cc48c..e8092ddbb3a6e21f4bb6cc4f9c6cf0ab0a5f62bd 100644 (file)
@@ -32,7 +32,7 @@ test_sv_game:
     - wget -O data/maps/stormkeep.waypoints https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/stormkeep.waypoints\r
     - wget -O data/maps/stormkeep.waypoints.cache https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/stormkeep.waypoints.cache\r
     - make\r
-    - EXPECT=7b55642e475a26f6fb397093e6f8fe81\r
+    - EXPECT=c7e360b409c6ceddff9c1407ce4e2090\r
     - HASH=$(${ENGINE} -noconfig -nohome +timestamps 1 +exec serverbench.cfg\r
       | tee /dev/stderr\r
       | sed -e 's,^\[[^]]*\] ,,'\r
index 1bd0eb7aeb5bb54bc9ba30a69d3cb32b6ac12ad9..64a31cdbf4a4ef3a133f444147e3edef86513e8e 100644 (file)
@@ -179,6 +179,8 @@ int _Movetype_FlyMove(entity this, float dt, bool applygravity, bool applystepno
                if(trace_fraction == 1)
                        break;
 
+               time_left *= 1 - trace_fraction;
+
                float my_trace_fraction = trace_fraction;
                vector my_trace_plane_normal = trace_plane_normal;
 
@@ -204,6 +206,7 @@ int _Movetype_FlyMove(entity this, float dt, bool applygravity, bool applystepno
                        // step - handle it immediately
                        vector org = this.origin;
                        vector steppush = '0 0 1' * stepheight;
+                       push = this.velocity * time_left;
 
                        if(!_Movetype_PushEntity(this, steppush, true, false))
                        {
@@ -250,8 +253,6 @@ int _Movetype_FlyMove(entity this, float dt, bool applygravity, bool applystepno
                        numplanes = 0;
                }
 
-               time_left *= 1 - my_trace_fraction;
-
                // clipped to another plane
                if(numplanes >= MAX_CLIP_PLANES)
                {