From ddf83fbbf19e1f21b2b51940ad7b9c9a76ac98c2 Mon Sep 17 00:00:00 2001 From: terminx Date: Fri, 14 May 2010 12:40:24 +0000 Subject: [PATCH] fix shrunk player speed git-svn-id: https://svn.eduke32.com/eduke32@1639 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/player.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/polymer/eduke32/source/player.c b/polymer/eduke32/source/player.c index 5712be873..b53df2a02 100644 --- a/polymer/eduke32/source/player.c +++ b/polymer/eduke32/source/player.c @@ -5274,18 +5274,22 @@ void P_ProcessInput(int32_t snum) j = 0; - if (shrunk) - j = (p->runspeed>>1)+(p->runspeed>>2); - else if (psectlotag == 2) + if (psectlotag == 2) j = 0x1400; else if (p->on_ground && (TEST_SYNC_KEY(sb_snum, SK_CROUCH) || (*kb > 10 && aplWeaponWorksLike[p->curr_weapon][snum] == KNEE_WEAPON))) j = 0x2000; - p->posvel.x = mulscale(p->posvel.x,p->runspeed-j,16); - p->posvel.y = mulscale(p->posvel.y,p->runspeed-j,16); + p->posvel.x = mulscale16(p->posvel.x,p->runspeed-j); + p->posvel.y = mulscale16(p->posvel.y,p->runspeed-j); if (klabs(p->posvel.x) < 2048 && klabs(p->posvel.y) < 2048) p->posvel.x = p->posvel.y = 0; + + if (shrunk) + { + p->posvel.x = mulscale16(p->posvel.x,p->runspeed-(p->runspeed>>1)+(p->runspeed>>2)); + p->posvel.y = mulscale16(p->posvel.y,p->runspeed-(p->runspeed>>1)+(p->runspeed>>2)); + } } HORIZONLY: