]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Alternate fix for jittery view while floating in the water frozen: make use of waterl... 815/head
authorMario <mario.mario@y7mail.com>
Sat, 23 May 2020 16:19:47 +0000 (02:19 +1000)
committerMario <mario.mario@y7mail.com>
Sat, 23 May 2020 16:19:47 +0000 (02:19 +1000)
qcsrc/common/physics/player.qc
qcsrc/ecs/systems/physics.qc

index 16abe38c80f6ca144389433c083e6db5c2a737c8..a04331d3d5a406edd092d3c989d814c439b74311 100644 (file)
@@ -616,11 +616,7 @@ void PM_check_frozen(entity this)
 {
        if (!PHYS_FROZEN(this))
                return;
 {
        if (!PHYS_FROZEN(this))
                return;
-       if (PHYS_DODGING_FROZEN(this)
-#ifdef SVQC
-       && IS_REAL_CLIENT(this)
-#endif
-       )
+       if (PHYS_DODGING_FROZEN(this) && IS_CLIENT(this))
        {
                // bind movement to a very slow speed so dodging can use .movement for directional calculations
                PHYS_CS(this).movement_x = bound(-2, PHYS_CS(this).movement.x, 2);
        {
                // bind movement to a very slow speed so dodging can use .movement for directional calculations
                PHYS_CS(this).movement_x = bound(-2, PHYS_CS(this).movement.x, 2);
@@ -630,13 +626,11 @@ void PM_check_frozen(entity this)
        else
                PHYS_CS(this).movement = '0 0 0';
 
        else
                PHYS_CS(this).movement = '0 0 0';
 
-       vector midpoint = ((this.absmin + this.absmax) * 0.5);
-       if (pointcontents(midpoint) == CONTENT_WATER)
+       if(this.waterlevel >= WATERLEVEL_SWIMMING)
        {
                this.velocity = this.velocity * 0.5;
        {
                this.velocity = this.velocity * 0.5;
-
-               if (pointcontents(midpoint + '0 0 16') == CONTENT_WATER)
-                       this.velocity_z = 200;
+               if(this.waterlevel >= WATERLEVEL_SUBMERGED)
+                       this.velocity.z = 160;
        }
 }
 
        }
 }
 
index 41506ec31778f41344218c81b42bf70d8cc711f9..e8c30dda5d4c710a6fbd348a8136bbf4d4888aae 100644 (file)
@@ -196,7 +196,7 @@ void sys_phys_simulate(entity this, float dt)
        if (this.com_phys_water) {
                // water jump only in certain situations
                // this mimics quakeworld code
        if (this.com_phys_water) {
                // water jump only in certain situations
                // this mimics quakeworld code
-               if (this.com_in_jump && this.waterlevel == WATERLEVEL_SWIMMING && this.velocity_z >= -180 && !this.viewloc) {
+               if (this.com_in_jump && this.waterlevel == WATERLEVEL_SWIMMING && this.velocity_z >= -180 && !this.viewloc && !PHYS_FROZEN(this)) {
                        vector yawangles = '0 1 0' * this.v_angle.y;
                        vector forward, right, up;
                        MAKE_VECTORS(yawangles, forward, right, up);
                        vector yawangles = '0 1 0' * this.v_angle.y;
                        vector forward, right, up;
                        MAKE_VECTORS(yawangles, forward, right, up);
@@ -222,7 +222,7 @@ void sys_phys_simulate(entity this, float dt)
        vector wishvel = forward * PHYS_CS(this).movement.x
            + right * PHYS_CS(this).movement.y
            + '0 0 1' * PHYS_CS(this).movement.z * (this.com_phys_vel_2d ? 0 : 1);
        vector wishvel = forward * PHYS_CS(this).movement.x
            + right * PHYS_CS(this).movement.y
            + '0 0 1' * PHYS_CS(this).movement.z * (this.com_phys_vel_2d ? 0 : 1);
-       if (this.com_phys_water) {
+       if (this.com_phys_water && !PHYS_FROZEN(this)) {
                if (PHYS_INPUT_BUTTON_CROUCH(this)) {
                        wishvel.z = -PHYS_MAXSPEED(this);
                }
                if (PHYS_INPUT_BUTTON_CROUCH(this)) {
                        wishvel.z = -PHYS_MAXSPEED(this);
                }
@@ -337,7 +337,7 @@ void sys_phys_simulate(entity this, float dt)
                                }
 
                                // holding jump button swims upward slowly
                                }
 
                                // holding jump button swims upward slowly
-                               if (this.com_in_jump && !this.viewloc) {
+                               if (this.com_in_jump && !this.viewloc && !PHYS_FROZEN(this)) {
                                        // was:
                                        // lava: 50
                                        // slime: 80
                                        // was:
                                        // lava: 50
                                        // slime: 80