[TF2] Fix Vaccinator resist icons persisting when a player changes (displayed) team #1452
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.
Whenever a player gains or loses Vaccinator resist conds, the client adds/removes a team-colored icon above their head corresponding to the resistance they have. However, if a player loses a resist cond and changes their displayed team on the same frame (such as when a disguised enemy spy being healed by a friendly Vaccinator medic undisguises, or when someone actually switches teams while being healed by the Vaccinator, manually or via round end team swap), the game only removes the icon corresponding to the team they just changed to, not the icon for the previous team, which is the one they actually have, so the icon stays above their head, and persists even through deaths (and gives away cloaked spies' positions).
Fixed by simply removing the icons for both teams whenever a player loses the relevant cond, instead of only the icon for their current displayed team.
Fixes ValveSoftware/Source-1-Games#2334, fixes ValveSoftware/Source-1-Games#3941