summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author/dev/humancontroller <devhc@example.com>2017-04-13 11:30:00 +0000
committer/dev/humancontroller <devhc@example.com>2017-04-15 17:24:19 +0200
commit25ca8e96ebb8fb4f6d656f03d83c90d4ebf42291 (patch)
treea1f15ff5ecd8ef381274c5a196a9f7f198600cdb
parent227a81048ce7efe21f63764b832d11099c62d59d (diff)
do not sink underwater
-rw-r--r--src/game/bg_pmove.c23
1 files changed, 5 insertions, 18 deletions
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 );