Skip to content

Conversation

@AndrewBetson
Copy link
Contributor

@AndrewBetson AndrewBetson commented Dec 29, 2025

Description

This PR fixes an oversight that prevents the see_enemy_health/mod see enemy health attribute from functioning when applied to any class other than Heavy or Medic.

Currently, the CTargetID::UpdateID function manually checks if the player is either a Heavy or Medic to determine whether to update target ID data or not.

This results in the enemy target IDs having no text when the attribute is applied to classes other than Heavy or Medic.

This PR fixes this issue by also checking pLocalTFPlayer for the see_enemy_health attribute.

The original manual checks for Heavy or Medic are left in place in case they are necessary for any obscure edge cases I'm not aware of.

Before After

…properly on classes other than Medic, Heavy, and Spy
@AndrewBetson AndrewBetson changed the title [TF2] Fix oversight preventing see_enemy_health attribute from functioning properly on classes other than Medic, Heavy, and Spy [TF2] Fix oversight preventing see_enemy_health attribute from functioning properly on classes other than Medic and Heavy Dec 29, 2025
@FlaminSarge
Copy link
Contributor

FlaminSarge commented Dec 29, 2025

This may have some overlap with #993.
In addition, it uses the 'same-team' target where the other PR uses the 'enemy' target (the other PR fixes up Spy behavior to use the 'enemy' target as well).

@AndrewBetson
Copy link
Contributor Author

Thanks for the heads up, it completely slipped my mind to check for any similar pre-existing PRs.

Closing.

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