Skip to content

cl_dll: ammo: fix WeaponList sprite not showing when FOV is at default#364

Open
GLoOoccK wants to merge 5 commits into
Velaron:mainfrom
GLoOoccK:MsgFunc_CurWeapon
Open

cl_dll: ammo: fix WeaponList sprite not showing when FOV is at default#364
GLoOoccK wants to merge 5 commits into
Velaron:mainfrom
GLoOoccK:MsgFunc_CurWeapon

Conversation

@GLoOoccK

Copy link
Copy Markdown
Contributor

Draw() was unconditionally calling HideCrosshair() whenever FOV > 40, wiping any sprite previously set via WeaponList + CurWeapon. At the same time, MsgFunc_CurWeapon was not managing the static sprite state, leaving m_hStaticSpr set with stale data during normal gameplay.

As a result, custom HUD sprites registered through this message pair were only visible when the player's FOV dropped to <= 40 (e.g. during AWP zoom), since that was the only path where HideCrosshair() was not called.

Additionally, MsgFunc_HideWeapon was not handling HIDEHUD_CROSSHAIR, so sending HideWeapon with that flag had no effect on the crosshair. The dynamic crosshair in Draw() was also not checking HIDEHUD_CROSSHAIR, leaving it visible when it should have been hidden.

#339

@GLoOoccK

Copy link
Copy Markdown
Contributor Author

cc @a1batross @Vladislav4KZ

@GLoOoccK

GLoOoccK commented Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

This PR fixes support for plugins such as the example below, which previously did not work:
https://forums.alliedmods.net/showthread.php?p=2503412
https://forums.alliedmods.net/showpost.php?p=2742394&postcount=19

@Vladislav4KZ

Copy link
Copy Markdown
Contributor

This PR fixes support for plugins such as the example below, which previously did not work:
https://forums.alliedmods.net/showthread.php?p=2503412
https://forums.alliedmods.net/showpost.php?p=2742394&postcount=19

Thanks for providing the plugin.

@Vladislav4KZ

Copy link
Copy Markdown
Contributor

I noticed that in this plugin, changing the crosshair causes HUD elements to appear in spectator mode, but this bug existed even before that PR.

Of course, this bug does not exist in the original CS 1.6 client.

@GLoOoccK

GLoOoccK commented Jun 2, 2026

Copy link
Copy Markdown
Contributor Author

The SPEC green crosshair is now displayed correctly when spectating. Previously, it was not shown at all, regardless of whether the plugin was enabled or disabled. The dynamic crosshair is also properly hidden when not in first-person view.

The behavior now closely matches the Steam client, at least in my testing.

@GLoOoccK GLoOoccK requested a review from Vladislav4KZ June 2, 2026 21:37
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