From f4616119c64ddcaa14cf10727e7aba4a3e64910f Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 4 Nov 2026 17:41:53 +0100 Subject: Items: skip the CNetworkArray length header for m_iAmmo/m_hMyWeapons The datamap offset points at the array length header, so every ammo count was read one type early. That made the RPG slot read the buckshot count (30) and permanently exceed the 3-rocket cap, which is why RPG pickups never showed and grenades/AR2/weapon ammo never hid. Read the elements 4 bytes after the field offset. --- CONTEXT.md | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'CONTEXT.md') diff --git a/CONTEXT.md b/CONTEXT.md index d1dbf26..92094bc 100644 --- a/CONTEXT.md +++ b/CONTEXT.md @@ -619,6 +619,12 @@ vocabulary / decisions. `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. +- The datamap offset for `m_iAmmo`/`m_hMyWeapons` points at the + `CNetworkArray` length header; the actual elements start **4 bytes later**. + Reading at the raw offset shifted every count by one type (e.g. RPG read the + buckshot count 30 against a max of 3, permanently hiding rockets). +- Chargers and ammo/supply crates are dispensers and are exempt from the + fullness filter. - 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