Skip to content

Conversation

ChaseTownsend
Copy link

This PR fixes any sniper rifle that is Not the Machina playing an empty sound if "sniper_full_charge_damage_bonus" is not 1

@ChaseTownsend ChaseTownsend changed the title Add Additional Check to tf_weapon_sniperrifle.cpp Add A Non full charge sound Check to tf_weapon_sniperrifle.cpp Sep 13, 2025
@ChaseTownsend ChaseTownsend changed the title Add A Non full charge sound Check to tf_weapon_sniperrifle.cpp [TF2] Add A Non full charge sound Check to tf_weapon_sniperrifle.cpp Sep 13, 2025
Bitl added a commit to BitlDevelopmentStudios/source-sdk-2013-bds-base that referenced this pull request Sep 14, 2025
@Bitl
Copy link
Contributor

Bitl commented Sep 14, 2025

i feel like restricting the sniper charge sound to only the machina would cause issues for modders who are trying to implement sniper rifles with this attribute.

a better change would be the following:

		// Prevents Non-Machina rifles with "sniper_full_charge_damage_bonus" 
		// from playing "SPECIAL3", which usually is Undefined
		const CEconItemView* pItem = GetAttributeContainer()->GetItem();

		if ( flDamageBonus > 1.0f && ( pItem && pItem->GetStaticData()->GetWeaponReplacementSound( GetTeamNumber(), SPECIAL3 ) ) )

this fixes the issue, while also allowing modders to implement their own sound effects for their sniper rifles.

Bitl added a commit to BitlDevelopmentStudios/source-sdk-2013-bds-base that referenced this pull request Sep 14, 2025
@ChaseTownsend
Copy link
Author

Yeah that looks much better than my version.
I didn't even know that you could get the sound replacement.

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.

2 participants