summaryrefslogtreecommitdiffstats
path: root/CONTEXT.md
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-11-04 17:41:53 +0100
committersalmonik <salmonik@tuta.io>2026-11-04 17:41:53 +0100
commitf4616119c64ddcaa14cf10727e7aba4a3e64910f (patch)
tree2cb68ab8dfde040a6fd1baa0e77039fba32019a4 /CONTEXT.md
parentItems/projectiles: ammo diagnostics, dispensers, launched RPG (diff)
downloadhl2h-f4616119c64ddcaa14cf10727e7aba4a3e64910f.tar.gz
hl2h-f4616119c64ddcaa14cf10727e7aba4a3e64910f.zip
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.
Diffstat (limited to '')
-rw-r--r--CONTEXT.md6
1 files changed, 6 insertions, 0 deletions
diff --git a/CONTEXT.md b/CONTEXT.md
index d1dbf26..92094bc 100644
--- a/CONTEXT.md
+++ b/CONTEXT.md
@@ -619,6 +619,12 @@ vocabulary / decisions.
619 `CBaseCombatCharacter::m_iAmmo` array) is compared with the `sk_max_*` cvar 619 `CBaseCombatCharacter::m_iAmmo` array) is compared with the `sk_max_*` cvar
620 (stock caps as fallback, e.g. RPG rockets = 3). Full ammo hides the pickup; 620 (stock caps as fallback, e.g. RPG rockets = 3). Full ammo hides the pickup;
621 if either value cannot be read the item stays visible. 621 if either value cannot be read the item stays visible.
622- The datamap offset for `m_iAmmo`/`m_hMyWeapons` points at the
623 `CNetworkArray` length header; the actual elements start **4 bytes later**.
624 Reading at the raw offset shifted every count by one type (e.g. RPG read the
625 buckshot count 30 against a max of 3, permanently hiding rockets).
626- Chargers and ammo/supply crates are dispensers and are exempt from the
627 fullness filter.
622- Scans the client entity list every 100 ms and tags health, ammo, armor/suit, 628- Scans the client entity list every 100 ms and tags health, ammo, armor/suit,
623 world weapon pickups, the two supply-crate models and generic items. 629 world weapon pickups, the two supply-crate models and generic items.
624- Each tag is a colored marker with a name and optional distance, filtered by 630- Each tag is a colored marker with a name and optional distance, filtered by