Enable shield HUD pickup icon via WeaponList/WeapPickup#1108
Enable shield HUD pickup icon via WeaponList/WeapPickup#1108s1lentq merged 1 commit intorehlds:masterfrom
Conversation
|
I think you need to write WeaponList in that place with MSG_INIT. |
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 :) |
Purpose
Enable the unused shield HUD icon in CS 1.6. Unlike weapons, the shield is not normally sent through the
WeaponListmessage, so its history icon never appears on pickup. However, the fileweapon_shieldgun.txtexists in the game resources with HUD icon data that was never utilized.Approach
Extend
GiveShieldto send aWeaponListplaceholder entry for the shield and trigger theWeapPickupmessage 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
Demonstration
https://www.youtube.com/watch?v=i2GEziOBA_o