From 710e8cc59557bc95ed74af8726ea13012fde50c3 Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 4 Nov 2026 17:25:31 +0100 Subject: Items: read ammo and inventory from the server arrays The client m_iAmmo/m_hMyWeapons recv props still do not resolve, but the listen server has the same CBaseCombatCharacter arrays in its datamap. Resolve m_iAmmo and m_hMyWeapons there: - reserve ammo comes from server_player_ammo() when the client array is missing, so full-ammo filtering works (RPG rockets at 3); - the owned-weapon mask is filled from the server m_hMyWeapons[48] handles, so fallen weapons count as ammo before the player equips them. Widen the datamap field-size filter to 512 for the 192-byte handle array. --- src/hl2h.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/hl2h.h') diff --git a/src/hl2h.h b/src/hl2h.h index 4f3552e..d8927c7 100644 --- a/src/hl2h.h +++ b/src/hl2h.h @@ -297,6 +297,8 @@ bool server_npc_has_follow_target(int idx); int server_npc_state(int idx); int server_npc_takedamage(int idx); int server_player_armor(int idx); +int server_player_ammo(int idx, int type); +uint32_t server_player_weapon(int idx, int slot); float server_grenade_detonate(int idx); float server_grenade_radius(int idx); int server_entity_count(); -- cgit v1.2.3