From 4019880cf113a2a13460ec8ea5bb30a5c8ed50f3 Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 4 Nov 2026 16:11:28 +0100 Subject: Items: hide full ammo pickups; robust close-target projection - Resolve m_iAmmo and m_hMyWeapons arrays from the client recv tables. - "Only if usable" now compares m_iAmmo[type] against sk_max_* (stock caps as fallback: RPG rockets 3, AR2 60, ...). Full ammo hides the pickup, including RPG rockets and fallen weapons converted to ammo. - Inventory now comes from m_hMyWeapons directly, so fallen weapons are ammo before the player equips the matching weapon. - Projection: fall back to local math when ScreenPosition claims "behind" for a point with positive view depth, and build NPC boxes from vertical samples so feet behind the near plane no longer drop the whole target. Log the first 8 near-target projection failures for diagnosis. --- 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 0c8ffb5..4f3552e 100644 --- a/src/hl2h.h +++ b/src/hl2h.h @@ -100,6 +100,8 @@ struct NetVars { int punch = -1; // client m_vecPunchAngle (aim punch) int default_fov = -1; // client m_iDefaultFOV (camera fov) int dmg_radius = -1; // client C_BaseGrenade::m_DmgRadius + int my_weapons = -1; // client m_hMyWeapons[48] array base + int ammo = -1; // client m_iAmmo[] array base // ponytail: mins/maxs may be absent from some HL2 netvar tables; esp.cpp falls back to h=72 bool ok() const { return flags >= 0 && velocity >= 0 && movetype >= 0; } // ponytail: m_iMaxHealth isn't a netvar in HL2 SP; esp.cpp falls back to 100. -- cgit v1.2.3