Skip to content

Enable shield HUD pickup icon via WeaponList/WeapPickup#1108

Merged
s1lentq merged 1 commit intorehlds:masterfrom
dystopm:giveshieldhud
Sep 26, 2025
Merged

Enable shield HUD pickup icon via WeaponList/WeapPickup#1108
s1lentq merged 1 commit intorehlds:masterfrom
dystopm:giveshieldhud

Conversation

@dystopm
Copy link
Contributor

@dystopm dystopm commented Aug 31, 2025

Purpose

Enable the unused shield HUD icon in CS 1.6. Unlike weapons, the shield is not normally sent through the WeaponList message, so its history icon never appears on pickup. However, the file weapon_shieldgun.txt exists in the game resources with HUD icon data that was never utilized.

Approach

Extend GiveShield to send a WeaponList placeholder entry for the shield and trigger the WeapPickup message when the player receives it. This activates the existing HUD assets so the shield displays its history icon consistently, matching the behavior of other items.

Learning

https://github.com/Velaron/cs16-client/blob/87518233ad5f35a9c0f6ea8919ba98c4145834b6/cl_dll/ammo.cpp#L631
https://github.com/Velaron/cs16-client/blob/main/cl_dll/ammohistory.h
https://github.com/Velaron/cs16-client/blob/87518233ad5f35a9c0f6ea8919ba98c4145834b6/cl_dll/ammo.cpp#L530

Pending

  • Check older CS 1.6 clients
  • WeaponList message and potential mod breakage (amxx is safe).

Demonstration

https://www.youtube.com/watch?v=i2GEziOBA_o

@fl0werD
Copy link
Contributor

fl0werD commented Sep 2, 2025

I think you need to write WeaponList in that place with MSG_INIT.
https://github.com/rehlds/ReGameDLL_CS/blob/master/regamedll/dlls/client.cpp#L235

@dystopm
Copy link
Contributor Author

dystopm commented Sep 2, 2025

I think you need to write WeaponList in that place with MSG_INIT. https://github.com/rehlds/ReGameDLL_CS/blob/master/regamedll/dlls/client.cpp#L235

We all know WeaponList is sent through the signon stream, issue is I’m modifying base netcode with this for a modification that can be mostly avoided (not everybody uses shield on servers) so I keep it on a harmless way inside GiveShield. Demos also are affected. In the learning section I left interesting code about both related messages, there is no problem in sending WeaponList after connection init - it is indeed done this way in Half-Life.

I did my homework :)

@s1lentq s1lentq merged commit ef10e35 into rehlds:master Sep 26, 2025
5 checks passed
@dystopm dystopm deleted the giveshieldhud branch September 28, 2025 18:12
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