From 9a2a314811f790337f03db2a4dee2d2787a475cd Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 17 Apr 2017 11:46:38 +1000 Subject: [PATCH] Update oldorigin when setting player's new position in a vehicle, fixes falldamage after exiting --- qcsrc/common/vehicles/vehicle/bumblebee.qc | 2 ++ qcsrc/common/vehicles/vehicle/racer.qc | 1 + qcsrc/common/vehicles/vehicle/raptor.qc | 1 + qcsrc/common/vehicles/vehicle/spiderbot.qc | 1 + 4 files changed, 5 insertions(+) diff --git a/qcsrc/common/vehicles/vehicle/bumblebee.qc b/qcsrc/common/vehicles/vehicle/bumblebee.qc index 69d7dbf89..1c9e6e1a4 100644 --- a/qcsrc/common/vehicles/vehicle/bumblebee.qc +++ b/qcsrc/common/vehicles/vehicle/bumblebee.qc @@ -99,6 +99,7 @@ bool bumblebee_gunner_frame(entity this, float dt) _out = autocvar_g_vehicle_bumblebee_cannon_turnlimit_in; setorigin(this, vehic.origin + v_up * -16 + v_forward * -16 + v_right * -128); } + this.oldorigin = this.origin; // negate fall damage crosshair_trace(this); vector _ct = trace_endpos; @@ -607,6 +608,7 @@ bool bumblebee_pilot_frame(entity this, float dt) makevectors(vehic.angles); vehic.angles_x *= -1; setorigin(this, vehic.origin + v_up * 48 + v_forward * 160); + this.oldorigin = this.origin; // negate fall damage PHYS_INPUT_BUTTON_ATCK(this) = PHYS_INPUT_BUTTON_ATCK2(this) = PHYS_INPUT_BUTTON_CROUCH(this) = false; } diff --git a/qcsrc/common/vehicles/vehicle/racer.qc b/qcsrc/common/vehicles/vehicle/racer.qc index b972f8aaf..b62eac09a 100644 --- a/qcsrc/common/vehicles/vehicle/racer.qc +++ b/qcsrc/common/vehicles/vehicle/racer.qc @@ -377,6 +377,7 @@ bool racer_frame(entity this, float dt) #endif setorigin(this, vehic.origin + '0 0 32'); + this.oldorigin = this.origin; // negate fall damage this.velocity = vehic.velocity; } diff --git a/qcsrc/common/vehicles/vehicle/raptor.qc b/qcsrc/common/vehicles/vehicle/raptor.qc index 78fdba511..269ea5fef 100644 --- a/qcsrc/common/vehicles/vehicle/raptor.qc +++ b/qcsrc/common/vehicles/vehicle/raptor.qc @@ -254,6 +254,7 @@ bool raptor_frame(entity this, float dt) vehic.velocity += df * dt; this.velocity = this.movement = vehic.velocity; setorigin(this, vehic.origin + '0 0 32'); + this.oldorigin = this.origin; // negate fall damage this.vehicle_weapon2mode = vehic.vehicle_weapon2mode; diff --git a/qcsrc/common/vehicles/vehicle/spiderbot.qc b/qcsrc/common/vehicles/vehicle/spiderbot.qc index a5411e843..164371e13 100644 --- a/qcsrc/common/vehicles/vehicle/spiderbot.qc +++ b/qcsrc/common/vehicles/vehicle/spiderbot.qc @@ -308,6 +308,7 @@ bool spiderbot_frame(entity this, float dt) this.vehicle_reload2 = 100 - ((vehic.gun2.cnt - time) / vehic.attack_finished_single[0]) * 100; setorigin(this, vehic.origin + '0 0 1' * vehic.maxs_z); + this.oldorigin = this.origin; // negate fall damage this.velocity = vehic.velocity; VEHICLE_UPDATE_PLAYER(this, vehic, health, spiderbot); -- 2.39.2