summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoman Tetelman <kevlarman@gmail.com>2009-10-03 11:49:08 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:15:22 +0000
commitd2a28e8dcf0acdbb4d2bcd030ba9953e4038ab29 (patch)
tree68a04da121e3a57094f435f32f9c72f0d024d04b /src
parent0f004824c2b380d3477aaaf36d0049d488816866 (diff)
* it is no longer possible to charge trample by walking into a wall
Diffstat (limited to 'src')
-rw-r--r--src/game/bg_pmove.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c
index 8eeb0f56..224cf0c1 100644
--- a/src/game/bg_pmove.c
+++ b/src/game/bg_pmove.c
@@ -2860,7 +2860,19 @@ static void PM_Weapon( void )
{
pm->ps->stats[ STAT_STATE ] &= ~SS_CHARGING;
if( pm->cmd.forwardmove > 0 )
- pm->ps->stats[ STAT_MISC ] += pml.msec;
+ {
+ int charge = pml.msec;
+ vec3_t dir,vel;
+
+ AngleVectors( pm->ps->viewangles, dir, NULL, NULL );
+ VectorCopy( pm->ps->velocity, vel );
+ VectorNormalize( vel );
+ vel[2] = 0;
+ dir[2] = 0;
+ charge *= DotProduct( dir, vel );
+
+ pm->ps->stats[ STAT_MISC ] += charge;
+ }
else
pm->ps->stats[ STAT_MISC ] = 0;
}