Skip to content

[TF2] Fix the weapon being invisible after the stun period expires #1203

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

TheNotoriousFrogposter
Copy link

When a stun is applied to the player, the weapon is set to be invisible. But after the stun is over, there isn't any code to set the weapon back to the visible state. This PR fixes this.

Before:

2025-04-17.11-17-30.mp4

After:

2025-04-17.11-14-11.mp4

@HyperionCoding
Copy link

I could see this easily conflicting with other conditions or content creators wanting to set weapon invisible.

@Bradasparky
Copy link

Bradasparky commented Apr 23, 2025

I could see this easily conflicting with other conditions or content creators wanting to set weapon invisible.

This is true, however content creators get around this by setting weapon visibility on tick. See VSH as an example with Hale's fists.

Even so, these checks aren't sufficient enough to make sure you're setting weapon visibility as harmlessly and least often as possible. You should specifically be checking for TF_STUN_CONTROLS and TF_STUN_LOSER_STATE because those are the only two which affect weapon visibility. For example, getting slowed by a Sandman ball doesn't change weapon visibility. This code should also be moved into ConditionThink where you have access to the specific stuns before the condition is removed.

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.

3 participants