From d2a28e8dcf0acdbb4d2bcd030ba9953e4038ab29 Mon Sep 17 00:00:00 2001 From: Roman Tetelman Date: Sat, 3 Oct 2009 11:49:08 +0000 Subject: * it is no longer possible to charge trample by walking into a wall --- src/game/bg_pmove.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src') 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; } -- cgit