]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Partially re-implement the .teleport_time field in player physics to prevent getting...
authorMario <mario.mario@y7mail.com>
Tue, 8 Jun 2021 02:48:29 +0000 (12:48 +1000)
committerMario <mario.mario@y7mail.com>
Tue, 8 Jun 2021 02:48:29 +0000 (12:48 +1000)
qcsrc/common/physics/player.qc
qcsrc/ecs/systems/physics.qc

index 1c55d3d14b58e13a02369f0ba49b9f4e9e63d2ec..24967d1c8169e547dde7fbd3e52cc8d998c65fd7 100644 (file)
@@ -450,6 +450,7 @@ void CheckWaterJump(entity this)
                {       // open at eye level
                        this.velocity_z = 225;
                        this.flags |= FL_WATERJUMP;
+                       this.teleport_time = time + 2; // safety net
                        SET_JUMP_HELD(this);
                }
        }
index 38d35d4b37a9b95bd56de2f516bced5ad4f05e91..c7fc88dc93593159e524a4e9920b32481362fdf2 100644 (file)
@@ -90,8 +90,9 @@ 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) {
+               if (time > this.teleport_time || this.waterlevel == WATERLEVEL_NONE) {
                        this.flags &= ~FL_WATERJUMP;
+                       this.teleport_time = 0;
                }
        } else if (MUTATOR_CALLHOOK(PM_Physics, this, maxspeed_mod, dt)) {
                // handled