From: Mario Date: Tue, 15 Dec 2015 14:50:03 +0000 (+1000) Subject: Make up/down work on ladders in side scrolling mode X-Git-Tag: xonotic-v0.8.2~1490 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=385ff5a01239d5f86682ac2005315c579b4eef61;p=xonotic%2Fxonotic-data.pk3dir.git Make up/down work on ladders in side scrolling mode --- 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;