[TF2] Fix issue where flaming friendly Snipers causes flame sfx when they're not actively using a bow #951
+13
−13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This happens because the
CTFFlameManager::OnCollide
andCTFFlameEntity::OnCollideWithTeammate
functions only early-exit if the flame collides with a teammate that isn't a Sniper, and not when it collides with a teammate that is a Sniper but isn't actively using a bow weapon.This causes friendly, non-bow-wielding Snipers to still be added to the
m_mapEntitiesBurnt
andm_hEntitiesBurnt
vectors of each class, at least one of which which is used... somewhere -- admittedly I didn't dig terribly deep into where exactly this occurs -- to play sound effects that convey to the player that they are flaming a flame-able entity.This PR fixes this by simply early-exiting in each of these functions if the flamed player is a Sniper but isn't actively using a bow weapon.
Before:
before.mp4
After:
after.mp4