From 78c527271faf470992fe1bdd5eaf6911df2fc1b1 Mon Sep 17 00:00:00 2001 From: Bukz Date: Mon, 25 Apr 2011 21:12:25 +0000 Subject: [PATCH] crouch/jump editing physics fixes git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6342 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/physics.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/src/physics.cpp b/source/src/physics.cpp index b09e6d2f..095e8253 100644 --- a/source/src/physics.cpp +++ b/source/src/physics.cpp @@ -405,7 +405,10 @@ void moveplayer(physent *pl, int moveres, bool local, int curtime) pl->jumpnext = true; // fly directly upwards while holding jump keybinds pl->vel.z = 0.5f; } - else if (pl->crouching) pl->vel.z = -0.5f; // fly directly down while holding crouch keybinds + else if (pl->trycrouch) + { + pl->vel.z = -0.5f; // fly directly down while holding crouch keybinds + } } else if(specfly) { @@ -748,10 +751,11 @@ void jumpn(bool on) void updatecrouch(playerent *p, bool on) { if(p->crouching == on) return; + if(p->state == CS_EDITING) return; // don't apply regular crouch physics in editfly const float crouchspeed = 0.6f; p->crouching = on; p->eyeheightvel = on ? -crouchspeed : crouchspeed; - if(p==player1 && p->state!=CS_EDITING) audiomgr.playsoundc(on ? S_CROUCH : S_UNCROUCH); + if(p==player1) audiomgr.playsoundc(on ? S_CROUCH : S_UNCROUCH); } void crouch(bool on)