From 50815614667db2a0bdb12ab0bacf2e33aa6fec9b Mon Sep 17 00:00:00 2001 From: Sabian Roberts <31491602+sabianroberts@users.noreply.github.com> Date: Mon, 28 Oct 2024 23:13:18 +0000 Subject: [PATCH] Clientside func_pushable fix --- pm_shared/pm_shared.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/pm_shared/pm_shared.c b/pm_shared/pm_shared.c index d9df5f4f..e1db655f 100644 --- a/pm_shared/pm_shared.c +++ b/pm_shared/pm_shared.c @@ -2864,6 +2864,15 @@ void PM_CheckParamters( void ) pmove->maxspeed = min( maxspeed, pmove->maxspeed ); } + // Slow down, I'm pulling it! (a box maybe) but only when I'm standing on ground + // + // JoshA: Moved this to CheckParamters rather than working on the velocity, + // as otherwise it affects every integration step incorrectly. + if ((pmove->onground != -1) && (pmove->cmd.buttons & IN_USE)) + { + pmove->maxspeed *= 1.0f / 3.0f; + } + if ( ( spd != 0.0 ) && ( spd > pmove->maxspeed ) ) { @@ -3036,14 +3045,6 @@ void PM_PlayerMove ( qboolean server ) } } -#if !defined( _TFC ) - // Slow down, I'm pulling it! (a box maybe) but only when I'm standing on ground - if ( ( pmove->onground != -1 ) && ( pmove->cmd.buttons & IN_USE) ) - { - VectorScale( pmove->velocity, 0.3, pmove->velocity ); - } -#endif - // Handle movement switch ( pmove->movetype ) {