]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Make up/down work on ladders in side scrolling mode
authorMario <mario@smbclan.net>
Tue, 15 Dec 2015 14:50:03 +0000 (00:50 +1000)
committerMario <mario@smbclan.net>
Tue, 15 Dec 2015 14:50:03 +0000 (00:50 +1000)
qcsrc/common/physics.qc
qcsrc/common/viewloc.qc

index 76e3ce9db81790e414bb9003318ad7542d59dc31..ff54434a8389c881d5a939e1a61de2150eb0a32c 100644 (file)
@@ -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();
index 0ad4d338218c07b4779c739a530385caf1b3ec8f..61c5149f326d222ea988b1c98f9917d2fb7d559b 100644 (file)
@@ -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;