]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'bones_was_here/stepup_distance' into 'master'
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)
Prevent players moving too far/fast when stepping up a staircase

Closes #2586

See merge request xonotic/xonotic-data.pk3dir!935

.gitlab-ci.yml
qcsrc/common/physics/movetypes/movetypes.qc

index 0e658481b6a431b939aedfffd4f8b0a4c783534c..f3d414f79e34d0ef2825c4cb5ab3d35aac91c347 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)
                {