From 385ff5a01239d5f86682ac2005315c579b4eef61 Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 16 Dec 2015 00:50:03 +1000 Subject: [PATCH] Make up/down work on ladders in side scrolling mode --- qcsrc/common/physics.qc | 5 +++++ qcsrc/common/viewloc.qc | 14 +++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/qcsrc/common/physics.qc b/qcsrc/common/physics.qc index 76e3ce9db..ff54434a8 100644 --- a/qcsrc/common/physics.qc +++ b/qcsrc/common/physics.qc @@ -922,6 +922,7 @@ void PM_swim(entity this, float maxspd_mod) } } +.vector oldmovement; void PM_ladder(entity this, float maxspd_mod) { // on a spawnfunc_func_ladder or swimming in spawnfunc_func_water @@ -943,6 +944,8 @@ void PM_ladder(entity this, float maxspd_mod) vector wishvel = v_forward * this.movement_x + v_right * this.movement_y + '0 0 1' * this.movement_z; + if(this.viewloc) + wishvel.z = this.oldmovement.x; this.velocity_z += g; if (this.ladder_entity.classname == "func_water") { @@ -1298,6 +1301,8 @@ void PM_Main(entity this) PM_ClientMovement_UpdateStatus(this, true); #endif + this.oldmovement = this.movement; + #ifdef SVQC WarpZone_PlayerPhysics_FixVAngle(); diff --git a/qcsrc/common/viewloc.qc b/qcsrc/common/viewloc.qc index 0ad4d3382..61c5149f3 100644 --- a/qcsrc/common/viewloc.qc +++ b/qcsrc/common/viewloc.qc @@ -13,8 +13,8 @@ void viewloc_PlayerPhysics(entity this) { if(this.viewloc) { - vector oldmovement = this.movement; - this.movement_x = oldmovement_y; + vector old_movement = this.movement; + this.movement_x = old_movement_y; this.movement_y = 0; if(this.movement_x < 0) @@ -32,12 +32,12 @@ void viewloc_PlayerPhysics(entity this) if(this.movement_x > 0) // right this.angles_y = forward_y; - if(oldmovement_x > 0) + if(old_movement_x > 0) #ifdef CSQC input_angles_x = #endif this.v_angle_x = this.angles_x = -50; - else if(oldmovement_x < 0) + else if(old_movement_x < 0) #ifdef CSQC input_angles_x = #endif @@ -45,11 +45,11 @@ void viewloc_PlayerPhysics(entity this) //if(!PHYS_INPUT_BUTTON_CROUCH(this) && !IS_DUCKED(this)) #ifdef SVQC - //this.BUTTON_CROUCH = (oldmovement_x < 0); - if (oldmovement.x < 0) + //this.BUTTON_CROUCH = (old_movement_x < 0); + if (old_movement.x < 0) this.BUTTON_CROUCH = true; #elif defined(CSQC) - if (oldmovement.x < 0) + if (old_movement.x < 0) { input_buttons |= BIT(4); this.flags |= FL_DUCKED; -- 2.39.2