]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Remove the 2 second buffer applied to water jumps and rely on the waterjump flag...
authorMario <mario.mario@y7mail.com>
Tue, 19 May 2020 00:56:38 +0000 (10:56 +1000)
committerMario <mario.mario@y7mail.com>
Tue, 19 May 2020 00:56:38 +0000 (10:56 +1000)
qcsrc/common/physics/player.qc
qcsrc/common/physics/player.qh
qcsrc/ecs/systems/cl_physics.qc
qcsrc/ecs/systems/physics.qc
qcsrc/lib/csqcmodel/cl_player.qc

index cba24ff8e90f2e986ba041f2f8b0597c06b318ae..6e4822422734779ed953c467cefc65b8913b86e2 100644 (file)
@@ -163,11 +163,8 @@ void PM_ClientMovement_UpdateStatus(entity this)
             setsize(this, STAT(PL_MIN, this), STAT(PL_MAX, this));
         }
        }
-#ifdef CSQC
 
-       if (IS_ONGROUND(this) || this.velocity.z <= 0 || PHYS_WATERJUMP_TIME(this) <= 0)
-               PHYS_WATERJUMP_TIME(this) = 0;
-#endif
+       _Movetype_CheckWater(this); // needs to be run on the client, might as well use the latest on the server too!
 }
 
 void CPM_PM_Aircontrol(entity this, float dt, vector wishdir, float wishspeed)
@@ -453,11 +450,6 @@ void CheckWaterJump(entity this)
                        this.velocity_z = 225;
                        this.flags |= FL_WATERJUMP;
                        SET_JUMP_HELD(this);
-               #ifdef SVQC
-                       PHYS_TELEPORT_TIME(this) = time + 2;    // safety net
-               #elif defined(CSQC)
-                       PHYS_WATERJUMP_TIME(this) = 2;
-               #endif
                }
        }
 }
index 97a4224233e3c4c55f9b0a4d0b80b1b50a2e0d07..3237fd43728429d767e9d7d1d5f0a877e3347bbf 100644 (file)
@@ -158,10 +158,6 @@ STATIC_INIT(PHYS_INPUT_BUTTON)
 #define ITEMS_STAT(s)                       ((s).items)
 
 .float teleport_time;
-#define PHYS_TELEPORT_TIME(s)               ((s).teleport_time)
-
-.float waterjump_time;
-#define PHYS_WATERJUMP_TIME(s)               ((s).waterjump_time)
 
 #ifdef CSQC
 
index fa087b5eb48bbb29c78bee163e703ee7e9e60a3a..624e0a9126e8a497272cf0ad2a9c98ec6b26b2eb 100644 (file)
@@ -3,7 +3,6 @@
 void sys_phys_fix(entity this, float dt)
 {
        this.team = myteam + 1; // is this correct?
-       PHYS_WATERJUMP_TIME(this) -= dt;
        this.movement = PHYS_INPUT_MOVEVALUES(this);
        this.items = STAT(ITEMS, this);
        if (!(PHYS_INPUT_BUTTON_JUMP(this))) // !jump
index 41506ec31778f41344218c81b42bf70d8cc711f9..4af74e002d3a2dabfcc28361d3a03197217d8281 100644 (file)
@@ -90,13 +90,8 @@ void sys_phys_update(entity this, float dt)
        if (this.flags & FL_WATERJUMP) {
                this.velocity_x = this.movedir.x;
                this.velocity_y = this.movedir.y;
-               if (this.waterlevel == WATERLEVEL_NONE
-                   || time > PHYS_TELEPORT_TIME(this)
-                   || PHYS_WATERJUMP_TIME(this) <= 0
-                  ) {
+               if (this.waterlevel == WATERLEVEL_NONE) {
                        this.flags &= ~FL_WATERJUMP;
-                       PHYS_TELEPORT_TIME(this) = 0;
-                       PHYS_WATERJUMP_TIME(this) = 0;
                }
        } else if (MUTATOR_CALLHOOK(PM_Physics, this, maxspeed_mod, dt)) {
                // handled
@@ -261,8 +256,7 @@ void sys_phys_simulate(entity this, float dt)
        float wishspeed = min(vlen(wishvel), this.com_phys_vel_max);
 
        if (this.com_phys_air) {
-               if ((IS_SVQC && time >= PHYS_TELEPORT_TIME(this))
-                   ||  (IS_CSQC && PHYS_WATERJUMP_TIME(this) <= 0)) {
+               if (!(this.flags & FL_WATERJUMP)) {
                        // apply air speed limit
                        float airaccelqw = PHYS_AIRACCEL_QW(this);
                        float wishspeed0 = wishspeed;
@@ -323,7 +317,7 @@ void sys_phys_simulate(entity this, float dt)
                if (this.com_phys_water) {
                        wishspeed *= 0.7;
 
-                       //      if (PHYS_WATERJUMP_TIME(this) <= 0) // TODO: use
+                       //      if (!(this.flags & FL_WATERJUMP)) // TODO: use
                        {
                                // water friction
                                float f = 1 - dt * PHYS_FRICTION(this);
@@ -407,7 +401,7 @@ void sys_phys_simulate(entity this, float dt)
                        return;
                }
 
-               if (IS_CSQC ? PHYS_WATERJUMP_TIME(this) <= 0 : time >= PHYS_TELEPORT_TIME(this)) {
+               if (!(this.flags & FL_WATERJUMP)) {
                        PM_Accelerate(this, dt, wishdir, wishspeed, wishspeed, this.com_phys_acc_rate, 1, 0, 0, 0);
                }
        }
index a5610b3de4024428a748bb7aaf375376d569e827..ef2ca0b9f26b43f35ab02a28030c064b2a8cabee 100644 (file)
@@ -129,7 +129,7 @@ void CSQCPlayer_Physics(entity this)
 {
        if(!autocvar_cl_movement) { return; }
 
-       _Movetype_CheckWater(this); // we apparently need to check water *before* physics so it can use this for water jump
+       //_Movetype_CheckWater(this); // we apparently need to check water *before* physics so it can use this for water jump
 
        vector oldv_angle = this.v_angle;
        vector oldangles = this.angles; // we need to save these, as they're abused by other code