From 25ca8e96ebb8fb4f6d656f03d83c90d4ebf42291 Mon Sep 17 00:00:00 2001 From: /dev/humancontroller Date: Thu, 13 Apr 2017 11:30:00 +0000 Subject: do not sink underwater --- src/game/bg_pmove.c | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c index c54fba0..16bf2ac 100644 --- a/src/game/bg_pmove.c +++ b/src/game/bg_pmove.c @@ -241,13 +241,8 @@ static void PM_Friction( void ) speed = VectorLength( vec ); - if( speed < 1 ) - { - vel[ 0 ] = 0; - vel[ 1 ] = 0; // allow sinking underwater - // FIXME: still have z friction underwater? + if( speed < 0.1 ) return; - } drop = 0; @@ -875,19 +870,11 @@ static void PM_WaterMove( void ) // // user intentions // - if( !scale ) - { - wishvel[ 0 ] = 0; - wishvel[ 1 ] = 0; - wishvel[ 2 ] = -60; // sink towards bottom - } - else - { - for( i = 0; i < 3; i++ ) - wishvel[ i ] = scale * pml.forward[ i ] * pm->cmd.forwardmove + scale * pml.right[ i ] * pm->cmd.rightmove; - wishvel[ 2 ] += scale * pm->cmd.upmove; - } + for( i = 0; i < 3; i++ ) + wishvel[ i ] = scale * pml.forward[ i ] * pm->cmd.forwardmove + scale * pml.right[ i ] * pm->cmd.rightmove; + + wishvel[ 2 ] += scale * pm->cmd.upmove; VectorCopy( wishvel, wishdir ); wishspeed = VectorNormalize( wishdir ); -- cgit