From 076f788ca65b63db5515d4b62ad2fc14d46686fe Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 7 Sep 2018 02:34:17 +1000 Subject: [PATCH] Fix crouching in 2D mode --- qcsrc/common/physics/player.qc | 2 ++ qcsrc/common/viewloc.qc | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/qcsrc/common/physics/player.qc b/qcsrc/common/physics/player.qc index f6ab29715..572bee349 100644 --- a/qcsrc/common/physics/player.qc +++ b/qcsrc/common/physics/player.qc @@ -119,6 +119,8 @@ void PM_ClientMovement_UpdateStatus(entity this) } } bool do_crouch = PHYS_INPUT_BUTTON_CROUCH(this); + if(this.viewloc && !(this.viewloc.spawnflags & VIEWLOC_FREEMOVE) && PHYS_CS(this).movement.x < 0) + do_crouch = true; if (have_hook) { do_crouch = false; //} else if (this.waterlevel >= WATERLEVEL_SWIMMING) { diff --git a/qcsrc/common/viewloc.qc b/qcsrc/common/viewloc.qc index f2dab7bfd..e1be43af0 100644 --- a/qcsrc/common/viewloc.qc +++ b/qcsrc/common/viewloc.qc @@ -48,7 +48,7 @@ void viewloc_PlayerPhysics(entity this) if(PHYS_CS(this).movement_x > 0) // right this.angles_y = forward.y; } - + #if 0 //if(!PHYS_INPUT_BUTTON_CROUCH(this) && !IS_DUCKED(this)) if(!(this.viewloc.spawnflags & VIEWLOC_FREEMOVE)) { @@ -65,6 +65,7 @@ void viewloc_PlayerPhysics(entity this) //else { input_buttons &= ~16; this.flags &= ~FL_DUCKED; } #endif } + #endif } } -- 2.39.2