Skip to content

[TF2] Fix dispenser healing being briefly interrupted when touching the dispenser #1298

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bakugo
Copy link

@bakugo bakugo commented May 20, 2025

Fixes ValveSoftware/Source-1-Games#5124

The dispenser has an m_hTouchingEntities vector that keeps track of which entities are near it. Entities are added to and removed from this vector both when touching the dispenser itself and its associated m_hTouchTrigger, meaning players will be present in the vector twice if they are touching both. CObjectDispenser::EndTouch() does not take this into account, and stops healing players when they stop touching the dispenser itself, even if they're still touching the surrounding trigger, resulting in a brief interruption in healing before it's resumed by DispenseThink() shortly after.

Fixed by not interrupting healing in EndTouch() if the player is still present in the vector after being removed from it once.

There's also another bug with the same cause that results in dispensers giving double the amount of metal when the engineer is touching them, but I'm not sure if that should be fixed since it noticeably affects balance.

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] [Bug?] Your own dispenser will stop healing you for a brief moment when you stop walking into it while touching it's bounding box
1 participant