Skip to content

Commit 380e08d

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% ref: ValveSoftware/Source-1-Games#3476
1 parent 6dc4a5f commit 380e08d

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
@@ -10529,12 +10529,17 @@ float CTFPlayer::TeamFortress_CalculateMaxSpeed( bool bIgnoreSpecialAbility /*=
1052910529
if ( playerclass == TF_CLASS_HEAVYWEAPONS )
1053010530
{
1053110531
float heavy_max_speed = default_speed * 1.35f;
10532-
if ( m_Shared.InCond( TF_COND_ENERGY_BUFF ) )
10533-
{
10532+
// We don't stack with other speed boosts like the GRU, they make berzerker mode too fast
10533+
// but if we are already faster than the berzerker speed, then we won't shift the speed back down
10534+
// (like with MvM upgrades)
10535+
if ( m_Shared.InCond( TF_COND_ENERGY_BUFF ) && maxfbspeed <= heavy_max_speed )
10536+
{
10537+
// If we aren't already above the cap, then boost our speed by 35%, but only up to 135%.
10538+
// this means if we are slower than normal, we boost relative to that, but if we are faster
10539+
// than normal, we only boost up to the cap.
1053410540
maxfbspeed *= 1.35f;
1053510541
if ( maxfbspeed > heavy_max_speed )
1053610542
{
10537-
// Prevent other speed modifiers like GRU from making berzerker mode too fast.
1053810543
maxfbspeed = heavy_max_speed;
1053910544
}
1054010545
}

0 commit comments

Comments
 (0)