Skip to content

Commit 8ce5adc

Browse files
committed
gameplay: make buffalo steak sandvich not reduce speed
the buffalo steak sandvich was made to not stack with other movement speed bonuses. however, the way this was implemented nullifies the greater of the two movement speed. this fix makes it so if we are already above the berzerker speed cap, we just don't apply berzerker speed at all and retain the faster speed. if we are below the cap, then we boost by 35% speed like normal, up to the berzerker cap of 135% this only applies to MvM movement speed bonuses, since nothing else can exceed the 135% cap in the base game. ref: ValveSoftware/Source-1-Games#3476
1 parent 2f557ac commit 8ce5adc

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/game/shared/tf/tf_player_shared.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10561,12 +10561,17 @@ float CTFPlayer::TeamFortress_CalculateMaxSpeed( bool bIgnoreSpecialAbility /*=
1056110561
if ( playerclass == TF_CLASS_HEAVYWEAPONS )
1056210562
{
1056310563
float heavy_max_speed = default_speed * 1.35f;
10564-
if ( m_Shared.InCond( TF_COND_ENERGY_BUFF ) )
10565-
{
10564+
// We don't stack with other speed boosts like the GRU, they make berzerker mode too fast
10565+
// but if we are already faster than the berzerker speed, then we won't shift the speed back down
10566+
// (like with MvM upgrades)
10567+
if ( m_Shared.InCond( TF_COND_ENERGY_BUFF ) && maxfbspeed <= heavy_max_speed )
10568+
{
10569+
// If we aren't already above the cap, then boost our speed by 35%, but only up to 135%.
10570+
// this means if we are slower than normal, we boost relative to that, but if we are faster
10571+
// than normal, we only boost up to the cap.
1056610572
maxfbspeed *= 1.35f;
1056710573
if ( maxfbspeed > heavy_max_speed )
1056810574
{
10569-
// Prevent other speed modifiers like GRU from making berzerker mode too fast.
1057010575
maxfbspeed = heavy_max_speed;
1057110576
}
1057210577
}

0 commit comments

Comments
 (0)