Skip to content

Conversation

@SirYodaJedi
Copy link

This PR fixes the Use input and function for func_wall to toggle between frames 0 and 1, as it did in GoldSrc.

When porting this entity, pev->frame was changed to a m_nState. Unlike GoldSrc's pev->frame, m_nState doesn't do anything on its own. This PR uses it as it seems to have been intended: to store the on/off state of the entity so that SetTextureFrameIndex() can be called accordingly. The Use input has also been updated to properly handle USE_TYPE.

Yes, I am aware that this can be achieved with env_texturetoggle, and that func_wall is deprecated by func_brush. This was an exercise and demonstration in how the underutilized SetTextureFrameIndex() can be used to toggle textures via code.

While this replicates GoldSrc behavior, no HLSDK code was used (as it would not have worked).

@SirYodaJedi SirYodaJedi marked this pull request as draft January 4, 2026 20:31
@SirYodaJedi
Copy link
Author

converted to draft because the USE_TYPE handling needs to be fixed

@SirYodaJedi
Copy link
Author

Potential fix for USE_TYPE handling; not sure if I'm doing it correctly.
Yuis-Archives/source-sdk-2025@func_wall_use_fix...Yuis-Archives:source-sdk-2025:func_wall_use_fix_fix

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.

1 participant