summaryrefslogtreecommitdiffstats
path: root/src/hl2h.h
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-11-04 16:11:28 +0100
committersalmonik <salmonik@tuta.io>2026-11-04 16:11:28 +0100
commit4019880cf113a2a13460ec8ea5bb30a5c8ed50f3 (patch)
tree5c13148671afd7d294273cff431c0ef373d862a3 /src/hl2h.h
parentClip transition and radius lines at the near plane (diff)
downloadhl2h-4019880cf113a2a13460ec8ea5bb30a5c8ed50f3.tar.gz
hl2h-4019880cf113a2a13460ec8ea5bb30a5c8ed50f3.zip
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.
Diffstat (limited to 'src/hl2h.h')
-rw-r--r--src/hl2h.h2
1 files changed, 2 insertions, 0 deletions
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 {
100 int punch = -1; // client m_vecPunchAngle (aim punch) 100 int punch = -1; // client m_vecPunchAngle (aim punch)
101 int default_fov = -1; // client m_iDefaultFOV (camera fov) 101 int default_fov = -1; // client m_iDefaultFOV (camera fov)
102 int dmg_radius = -1; // client C_BaseGrenade::m_DmgRadius 102 int dmg_radius = -1; // client C_BaseGrenade::m_DmgRadius
103 int my_weapons = -1; // client m_hMyWeapons[48] array base
104 int ammo = -1; // client m_iAmmo[] array base
103 // ponytail: mins/maxs may be absent from some HL2 netvar tables; esp.cpp falls back to h=72 105 // ponytail: mins/maxs may be absent from some HL2 netvar tables; esp.cpp falls back to h=72
104 bool ok() const { return flags >= 0 && velocity >= 0 && movetype >= 0; } 106 bool ok() const { return flags >= 0 && velocity >= 0 && movetype >= 0; }
105 // ponytail: m_iMaxHealth isn't a netvar in HL2 SP; esp.cpp falls back to 100. 107 // ponytail: m_iMaxHealth isn't a netvar in HL2 SP; esp.cpp falls back to 100.