Skip to content

[TF2] Revenge Crits are no longer consumed when Crit boosted by another source - #2095

Open
JoriKos wants to merge 1 commit into
ValveSoftware:masterfrom
JoriKos:revenge-crits-boost-fix
Open

JoriKos wants to merge 1 commit into
ValveSoftware:masterfrom
JoriKos:revenge-crits-boost-fix

Conversation

@JoriKos

@JoriKos JoriKos commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Currently when Crit boosted by any means, such as a Kritzkrieg ÜberCharge or Crumpkins, Revenge Crits are consumed upon firing. This means that being given a Crit boost as a reward for something (e.g., capping the Intelligence) or if a Medic spends a precious Kritzkrieg ÜberCharge on you (as tactically questionable as that may be for the current Revenge Crit-capable weapons), every shot you fire essentially becomes a punishment too as it takes away a Revenge Crit you earned without really having a choice. This PR changes that to not consume Revenge Crits if you are already under the effect of another Crit boost.

The fix itself consists of a new condition (TF_COND_REVENGECRITBOOSTED), checking if another Crit condition is active, and then setting a bool accordingly. I've also added ResetRevengeCrits() to avoid this Crit condition check when the intention is to remove all Revenge Crits, otherwise it may prevent it based on the new check. From testing, it works fine, but please let me know if there are any issues.

Resolves ValveSoftware/Source-1-Games#5221

pPlayer->m_Shared.SetRevengeCrits( 0 );
pPlayer->m_Shared.RemoveCond( TF_COND_CRITBOOSTED );
pPlayer->m_Shared.ResetRevengeCrits();
pPlayer->m_Shared.RemoveCond( TF_COND_REVENGECRITBOOSTED );

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can get rid of the RemoveCond call here since ResetRevengeCrits already calls that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought the same, but SetRevengeCrits() also called RemoveCond() in the current implementation so I kinda left it in as I wasn't sure if it messed with any obscure behaviours. I'll probably remove it later (if no other issues pop up) as it does seem unnecessary.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SetRevengeCrits only calls RemoveCond when the current weapon has revenge crits and you're already in the crit-boosted condition, so I'd assume the extra RemoveCond calls were covering cases outside of those. Your ResetRevengeCrits calls RemoveCond unconditionally though, so removing these calls should be harmless now.

pPlayer->m_Shared.SetRevengeCrits( 0 );
pPlayer->m_Shared.RemoveCond( TF_COND_CRITBOOSTED );
pPlayer->m_Shared.ResetRevengeCrits();
pPlayer->m_Shared.RemoveCond( TF_COND_REVENGECRITBOOSTED );

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

pPlayer->m_Shared.SetRevengeCrits( 0 );
pPlayer->m_Shared.RemoveCond( TF_COND_CRITBOOSTED );
pPlayer->m_Shared.ResetRevengeCrits();
pPlayer->m_Shared.RemoveCond( TF_COND_REVENGECRITBOOSTED );

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TF2] [Feature Request] Tweak to weapons that store crits (Frontier Justice, Diamondback, Manmelter)

2 participants