Skip to content

Commit 6fbda8f

Browse files
committed
add air strafing emulation to new parachute
1 parent 0791f77 commit 6fbda8f

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

src/game/shared/tf/tf_gamemovement.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2447,6 +2447,21 @@ void CTFGameMovement::AirMove( void )
24472447
VectorNormalize( vecCurrentXY );
24482448

24492449
flDot = DotProduct( vecCurrentXY, wishdir );
2450+
2451+
// sus out air strafing, and then apply forward move. this makes it easier for players who are used to classic air movement.
2452+
if ( flDot < -0.01f && fabs(mv->m_flForwardMove) < 0.1f && fabs(mv->m_flSideMove) > 0.1f )
2453+
{
2454+
mv->m_flForwardMove = fabs(mv->m_flSideMove);
2455+
2456+
for (int j = 0 ; j < 2 ; j++)
2457+
wishvel[j] = forward[j]*mv->m_flForwardMove + right[j]*mv->m_flSideMove;
2458+
wishvel[2] = 0;
2459+
2460+
VectorCopy(wishvel, wishdir);
2461+
wishspeed = VectorNormalize(wishdir);
2462+
2463+
flDot = DotProduct( vecCurrentXY, wishdir );
2464+
}
24502465

24512466
if ( flDot < 0.0f )
24522467
{

0 commit comments

Comments
 (0)