summaryrefslogtreecommitdiffstats
path: root/CONTEXT.md
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 /CONTEXT.md
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 '')
-rw-r--r--CONTEXT.md18
1 files changed, 13 insertions, 5 deletions
diff --git a/CONTEXT.md b/CONTEXT.md
index acdab2f..839d340 100644
--- a/CONTEXT.md
+++ b/CONTEXT.md
@@ -232,7 +232,11 @@ vocabulary / decisions.
232 (>1e7). A point on the view axis (e.g. directly below the player's feet) 232 (>1e7). A point on the view axis (e.g. directly below the player's feet)
233 can make `IVDebugOverlay::ScreenPosition` return NaN/huge values; casting 233 can make `IVDebugOverlay::ScreenPosition` return NaN/huge values; casting
234 those to int corrupted the ISurface clip state and made the whole overlay 234 those to int corrupted the ISurface clip state and made the whole overlay
235 disappear for that frame. 235 disappear for that frame. If the overlay reports "behind" for a point whose
236 view-space depth is actually positive, a local projection is used instead.
237- NPC boxes are built from several vertical samples, so a target whose feet
238 are behind the near plane (standing over it) still gets a box from the
239 visible span instead of being dropped.
236- Projectile radius rings are drawn independently of the centre marker, so a 240- Projectile radius rings are drawn independently of the centre marker, so a
237 grenade behind the camera/off-screen still shows its blast circle when any 241 grenade behind the camera/off-screen still shows its blast circle when any
238 part of the ring projects. 242 part of the ring projects.
@@ -606,10 +610,14 @@ vocabulary / decisions.
606- A world weapon whose type is already in the local player's inventory is 610- A world weapon whose type is already in the local player's inventory is
607 reclassified as ammo (`SMG ammo`, `AR2 ammo`, ...). Owner handles are 611 reclassified as ammo (`SMG ammo`, `AR2 ammo`, ...). Owner handles are
608 unreliable on this client (`m_hOwnerEntity`/`m_hOwner` resolve to -1), so 612 unreliable on this client (`m_hOwnerEntity`/`m_hOwner` resolve to -1), so
609 the inventory mask is accumulated from every weapon type the player has 613 the inventory is read directly from the local `m_hMyWeapons[48]` handle
610 held (client `m_hActiveWeapon`, with the server handle as fallback) since 614 array (and remembered active types as a fallback). NPC-held weapons are
611 the current local entity appeared. NPC-held weapons are therefore ignored. 615 therefore ignored. Weapons the player does not own stay under the Weapons
612 Weapons the player does not own stay under the Weapons category. 616 category.
617- Ammo pickups also honour "Only if usable": the reserve count from
618 `m_iAmmo[type]` is compared with the `sk_max_*` cvar (stock caps as fallback,
619 e.g. RPG rockets = 3). Full ammo hides the pickup; if either value cannot
620 be read the item stays visible.
613- Scans the client entity list every 100 ms and tags health, ammo, armor/suit, 621- Scans the client entity list every 100 ms and tags health, ammo, armor/suit,
614 world weapon pickups, the two supply-crate models and generic items. 622 world weapon pickups, the two supply-crate models and generic items.
615- Each tag is a colored marker with a name and optional distance, filtered by 623- Each tag is a colored marker with a name and optional distance, filtered by