From b260f26c7c944202d9dc62277dd652ad7254ccbb Mon Sep 17 00:00:00 2001 From: driAn Date: Fri, 10 Oct 2008 20:08:11 +0000 Subject: [PATCH] fixed crouching speed bug git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@2880 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/physics.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/src/physics.cpp b/source/src/physics.cpp index 64a88a3c..f179634f 100644 --- a/source/src/physics.cpp +++ b/source/src/physics.cpp @@ -351,7 +351,8 @@ void moveplayer(physent *pl, int moveres, bool local, int curtime) int move = pl->onladder && !pl->onfloor && pl->move == -1 ? 0 : pl->move; // movement on ladder water = hdr.waterlevel>pl->o.z-0.5f; - const float speed = curtime/(water ? 2000.0f : 1000.0f)*pl->maxspeed*(pl->crouching ? 0.5f : 1.0f); + const bool crouching = pl->crouching || pl->eyeheight < pl->maxeyeheight; + const float speed = curtime/(water ? 2000.0f : 1000.0f)*pl->maxspeed*(crouching ? 0.5f : 1.0f); const float friction = water ? 20.0f : (pl->onfloor || editfly || specfly ? 6.0f : (pl->onladder ? 1.5f : 30.0f)); const float fpsfric = max(friction/curtime*20.0f, 1.0f);