From: Mario Date: Thu, 6 Sep 2018 16:34:17 +0000 (+1000) Subject: Fix crouching in 2D mode X-Git-Tag: xonotic-v0.8.5~1903 X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=076f788ca65b63db5515d4b62ad2fc14d46686fe Fix crouching in 2D mode --- 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 } }