]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Undo physics changes related to hash change of 0e542a1e
authorotta8634 <k9wolf@pm.me>
Sat, 18 Jan 2025 07:52:46 +0000 (15:52 +0800)
committerotta8634 <k9wolf@pm.me>
Sat, 18 Jan 2025 07:52:46 +0000 (15:52 +0800)
This commit altered how physics code works, changing the hash.
This is a regression.
The rest of the changes in 0e542a1e didn't update the hash, and logically speaking shouldn't alter how physics works.
Undid changes which led to the hash change, at the tiny cost of some lost regained performance.

.gitlab-ci.yml
qcsrc/ecs/systems/physics.qc

index b45e9f27bed26ef1a8cbdabc9729d4b89c331d0c..7a70b79b2793cd9e5539263f92e127fba6ebbb9e 100644 (file)
@@ -45,7 +45,7 @@ test_compilation_units:
 test_sv_game:
   stage: test
   script:
-    - export EXPECT=f5fbfbd04a22e781397cfd14db367419
+    - export EXPECT=ee6d65824c57cb6d83cba31481a21822
     - qcsrc/tools/sv_game-hashtest.sh
     - exit $?
 
index 42fdb5109975f2131aef1df6f5b76903b3882d59..d678038a0581da7e6fea32b8f3698f62b756140c 100644 (file)
@@ -266,11 +266,8 @@ void sys_phys_simulate(entity this, float dt)
        }
 
        // acceleration
-       float wishvel_len = vlen(wishvel);
-       float wishspeed = min(wishvel_len, this.com_phys_vel_max);
-
-       // same as wishdir = normalize(wishvel); but cheaper
-       const vector wishdir = (wishvel_len ? wishvel / wishvel_len : '0 0 0');
+       const vector wishdir = normalize(wishvel);
+       float wishspeed = min(vlen(wishvel), this.com_phys_vel_max);
 
        if (this.com_phys_air) {
                if (!(this.flags & FL_WATERJUMP)) {