From: Mario Date: Tue, 8 Jun 2021 02:48:29 +0000 (+1000) Subject: Partially re-implement the .teleport_time field in player physics to prevent getting... X-Git-Tag: xonotic-v0.8.5~405^2~12 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=03d5541c7c43a7efceab1bc5dd68e11a8b12bed2;p=xonotic%2Fxonotic-data.pk3dir.git Partially re-implement the .teleport_time field in player physics to prevent getting stuck in some maps, workaround for #2596 --- diff --git a/qcsrc/common/physics/player.qc b/qcsrc/common/physics/player.qc index 1c55d3d14..24967d1c8 100644 --- a/qcsrc/common/physics/player.qc +++ b/qcsrc/common/physics/player.qc @@ -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); } } diff --git a/qcsrc/ecs/systems/physics.qc b/qcsrc/ecs/systems/physics.qc index 38d35d4b3..c7fc88dc9 100644 --- a/qcsrc/ecs/systems/physics.qc +++ b/qcsrc/ecs/systems/physics.qc @@ -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