Skip to content

Conversation

@naydef
Copy link

@naydef naydef commented Oct 24, 2025

Fixes ValveSoftware/Source-1-Games#6223

I'm a bit concerned if this fix will be working correctly if m_flNextPrimaryAttack becomes too high (loss of resolution).
Maybe it does not matter...

Suggestions welcomed

@naydef naydef changed the title Fix high melee firing speed not working correctly [TF2] Fix high melee firing speed not working correctly Oct 24, 2025
m_flSmackTime = GetSmackTime( m_iWeaponMode );
if(m_flSmackTime >= m_flNextPrimaryAttack)
{
m_flSmackTime = m_flNextPrimaryAttack - 0.01;
Copy link
Contributor

@ficool2 ficool2 Oct 24, 2025

Choose a reason for hiding this comment

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

Not only can this be problematic with float resolution, it won't work correctly on servers running higher tickrates (like 100)

An alternative approach to this whole PR which I suggest you try, is to run Smack() if smacktime >= primaryattacktime when the player tries attacking again

Copy link
Author

Choose a reason for hiding this comment

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

Yea, I knew this is not the best approach. I'll try your idea and report back.

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] Melee weapons with very fast firing speed won't register hits when holding primary attack

2 participants