summaryrefslogtreecommitdiffstats
path: root/src/netvars.cpp
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-11-04 14:28:21 +0100
committersalmonik <salmonik@tuta.io>2026-11-04 14:28:21 +0100
commit714262bcf759a238daf906de16e7b204712a104f (patch)
treed208ecfbbdb0f5f2f27aa888c806e38198ad1d52 /src/netvars.cpp
parentRemove gamma slider; keep HDR brightness (diff)
downloadhl2h-714262bcf759a238daf906de16e7b204712a104f.tar.gz
hl2h-714262bcf759a238daf906de16e7b204712a104f.zip
Add usable item filter, projectile ESP and gravity-gun melee
- Items: "Only if usable" hides health tags at full health and armor at full suit. Health ceiling is the server player's m_iMaxHealth; armor uses the server m_ArmorValue against HL2's 100 cap. Fails open when unreadable. - Projectiles: new Visuals feature/card for thrown grenades, RPG rockets, helicopter bombs and AR2 balls. Fuse from server m_flDetonateTime vs engine time; radius from m_DmgRadius with per-type fallback; optional 24-segment radius ring and FRAG timer label. - Melee: the killbot now handles the gravity gun as well; only VULNERABLE targets, 1200-unit range, primary attack to launch the held object, and no aim-punch compensation because the launch uses EyeVectors. - Server/netvars: m_ArmorValue, m_flDetonateTime, m_DmgRadius.
Diffstat (limited to '')
-rw-r--r--src/netvars.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/netvars.cpp b/src/netvars.cpp
index 33fd6a3..ef564cd 100644
--- a/src/netvars.cpp
+++ b/src/netvars.cpp
@@ -107,6 +107,11 @@ static void collect_netvars(uintptr_t table, uintptr_t base_off, int depth) {
107 int off = (int)(base_off + (uint32_t)poff); 107 int off = (int)(base_off + (uint32_t)poff);
108 if (off >= 0x20 && off <= 0x2000) 108 if (off >= 0x20 && off <= 0x2000)
109 g_net.default_fov = off; 109 g_net.default_fov = off;
110 } else if (strcmp(pname2, "m_DmgRadius") == 0 &&
111 g_net.dmg_radius < 0) {
112 int off = (int)(base_off + (uint32_t)poff);
113 if (off >= 0x20 && off <= 0x2000)
114 g_net.dmg_radius = off;
110 } else if (strcmp(pname2, "m_iTeamNum") == 0 && g_net.teamnum < 0) { 115 } else if (strcmp(pname2, "m_iTeamNum") == 0 && g_net.teamnum < 0) {
111 g_net.teamnum = (int)(base_off + (uint32_t)poff); 116 g_net.teamnum = (int)(base_off + (uint32_t)poff);
112 } else if (strcmp(pname2, "m_vecOrigin") == 0 && g_net.origin < 0) { 117 } else if (strcmp(pname2, "m_vecOrigin") == 0 && g_net.origin < 0) {
@@ -288,11 +293,12 @@ void resolve_netvars() {
288 logf("netvars: flags=%d velocity=%d movetype=%d health=%d maxhealth=%d " 293 logf("netvars: flags=%d velocity=%d movetype=%d health=%d maxhealth=%d "
289 "teamnum=%d origin=%d viewoffset=%d mins=%d maxs=%d lifeste=%d " 294 "teamnum=%d origin=%d viewoffset=%d mins=%d maxs=%d lifeste=%d "
290 "modelindex=%d absvelocity=%d activeweapon=%d owner=%d " 295 "modelindex=%d absvelocity=%d activeweapon=%d owner=%d "
291 "weapon_owner=%d clr_render=%d punch=%d default_fov=%d", 296 "weapon_owner=%d clr_render=%d punch=%d default_fov=%d "
297 "dmg_radius=%d",
292 g_net.flags, g_net.velocity, g_net.movetype, g_net.health, 298 g_net.flags, g_net.velocity, g_net.movetype, g_net.health,
293 g_net.maxhealth, g_net.teamnum, g_net.origin, g_net.viewoffset, 299 g_net.maxhealth, g_net.teamnum, g_net.origin, g_net.viewoffset,
294 g_net.mins, g_net.maxs, g_net.lifestate, g_net.modelindex, 300 g_net.mins, g_net.maxs, g_net.lifestate, g_net.modelindex,
295 g_net.absvelocity, g_net.activeweapon, g_net.owner, 301 g_net.absvelocity, g_net.activeweapon, g_net.owner,
296 g_net.weapon_owner, g_net.clr_render, g_net.punch, 302 g_net.weapon_owner, g_net.clr_render, g_net.punch,
297 g_net.default_fov); 303 g_net.default_fov, g_net.dmg_radius);
298} 304}