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. --- CONTEXT.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'CONTEXT.md') diff --git a/CONTEXT.md b/CONTEXT.md index 839d340..d1dbf26 100644 --- a/CONTEXT.md +++ b/CONTEXT.md @@ -610,14 +610,15 @@ vocabulary / decisions. - A world weapon whose type is already in the local player's inventory is reclassified as ammo (`SMG ammo`, `AR2 ammo`, ...). Owner handles are unreliable on this client (`m_hOwnerEntity`/`m_hOwner` resolve to -1), so - the inventory is read directly from the local `m_hMyWeapons[48]` handle - array (and remembered active types as a fallback). NPC-held weapons are - therefore ignored. Weapons the player does not own stay under the Weapons - category. + the inventory is read from the authoritative server + `CBaseCombatCharacter::m_hMyWeapons[48]` array (client `m_hMyWeapons` and the + remembered active weapon are fallbacks). NPC-held weapons are ignored. + Weapons the player does not own stay under the Weapons category. - Ammo pickups also honour "Only if usable": the reserve count from - `m_iAmmo[type]` is compared with the `sk_max_*` cvar (stock caps as fallback, - e.g. RPG rockets = 3). Full ammo hides the pickup; if either value cannot - be read the item stays visible. + `m_iAmmo[type]` (client array when resolved, otherwise the server + `CBaseCombatCharacter::m_iAmmo` array) is compared with the `sk_max_*` cvar + (stock caps as fallback, e.g. RPG rockets = 3). Full ammo hides the pickup; + if either value cannot be read the item stays visible. - Scans the client entity list every 100 ms and tags health, ammo, armor/suit, world weapon pickups, the two supply-crate models and generic items. - Each tag is a colored marker with a name and optional distance, filtered by -- cgit v1.2.3