From 9904891162a6749d39110110c0812a64c241a7ea Mon Sep 17 00:00:00 2001 From: salmonik Date: Tue, 27 Oct 2026 21:22:47 +0100 Subject: Remove stucklaunch; add valuable-item ESP - Drop the stucklaunch feature, its settings, diagnostics and m_hGroundEntity resolution. - Add a Visuals feature that scans the client entity list for valuable pickups: health/medkits/chargers, ammo boxes/crates/grenades, batteries, HEV suit modules/chargers, supply crates and generic items. - Model-first classification with class fallbacks; category toggles, distance labels and a max-distance slider. - Draw colored marker/label tags through walls, independent of the hostile NPC ESP. - Persist [items] active/bind/health/ammo/armor/crates/distance/max_dist; Reset restores defaults; GUI card and CONTEXT updated. --- src/hl2h.cpp | 93 ++---------------------------------------------------------- 1 file changed, 3 insertions(+), 90 deletions(-) (limited to 'src/hl2h.cpp') diff --git a/src/hl2h.cpp b/src/hl2h.cpp index defdd27..c51d35e 100644 --- a/src/hl2h.cpp +++ b/src/hl2h.cpp @@ -169,75 +169,6 @@ static void apply_autostrafe(CUserCmd *cmd, const float *vel) { cmd->sidemove = (dx * rx + dy * ry) * 450.0f; } -// True while the player stands on (or just left) a physics prop. m_hGroundEntity -// is latched briefly because it clears during each hop. -static bool stucklaunch_prop_ok(void *ent, int tick) { - if (g_net.groundentity < 0) { - static bool logged = false; - if (!logged) { - logged = true; - logf("stucklaunch: m_hGroundEntity unavailable; prop detection off"); - } - return true; // no netvar: the bind is the only safeguard - } - static int last_prop_tick = -100000; - uint32_t h = *(uint32_t *)((uintptr_t)ent + g_net.groundentity); - int gi = (h == 0xFFFFFFFFu) ? 0 : (int)(h & 0xFFFF); - bool on = gi > 0 && gi <= 4096 && entity_is_physics_prop(gi); - if (on) { - static int prop_logs = 0; - if (prop_logs < 4) { - prop_logs++; - logf("stucklaunch: prop idx=%d engaged", gi); - } - last_prop_tick = tick; - } else { - static int miss_logs = 0; - if (miss_logs < 4) { - miss_logs++; - logf("stucklaunch: ground h=%#x idx=%d is not a physics prop", h, gi); - } - } - return tick - last_prop_tick < 32; // ~0.5 s at 66 tick -} - -// Stucklaunch assist. The player supplies the physics prop and a little -// initial speed; this holds jump, alternates +use (and optionally the gravity -// gun's +attack) to keep regrabbing the prop, and air-strafes the hops. -static void stucklaunch_apply(CUserCmd *cmd, void *local_ent, bool onground, - const float *vel) { - static bool engaged_logged = false; - if (!engaged_logged) { - engaged_logged = true; - logf("stucklaunch: applying jump/spam (onground=%d)", (int)onground); - } - cmd->buttons |= IN_JUMP; - int period = stucklaunch_spam_ticks(); - if (period < 1) - period = 1; - int phase = (cmd->tick_count / period) & 1; - bool gravity = stucklaunch_gravspam_enabled() && - active_weapon_is_gravity_gun(local_ent); - if (gravity) { - // Pick up with +attack, drop with +use on the next half-cycle. Pressing - // both together would punt instead of regrabbing. - if (phase == 0) { - cmd->buttons |= IN_ATTACK; - cmd->buttons &= ~IN_USE; - } else { - cmd->buttons |= IN_USE; - cmd->buttons &= ~IN_ATTACK; - } - } else if (stucklaunch_use_spam_enabled()) { - if (phase == 0) - cmd->buttons |= IN_USE; - else - cmd->buttons &= ~IN_USE; - } - if (stucklaunch_autostrafe_enabled() && !onground) - apply_autostrafe(cmd, vel); -} - // --------------------------------------------------------------------------- // jumpbug // --------------------------------------------------------------------------- @@ -645,23 +576,8 @@ static void do_move(int seq, float frametime) { return; } - bool stuck_on = feature_active(FEAT_STUCKLAUNCH); - if (g_stucklaunch.active) { - static bool state_logged = false; - if (!state_logged) { - state_logged = true; - logf("stucklaunch: active=1 run=%d bind=%d groundoff=%d", - (int)stuck_on, g_stucklaunch.bind, g_net.groundentity); - } - } - bool stuck_engaged = stuck_on && stucklaunch_prop_ok(ent, cmd->tick_count); - if (stuck_engaged) { - stucklaunch_apply(cmd, ent, onground, vel); - note_modified(cmd, flags, vel); - } - - bool bhop_on = !stuck_engaged && feature_active(FEAT_BHOP); - bool abh_on = !stuck_engaged && feature_active(FEAT_ABH); + bool bhop_on = feature_active(FEAT_BHOP); + bool abh_on = feature_active(FEAT_ABH); static bool lastground = false; @@ -712,8 +628,7 @@ static void do_move(int seq, float frametime) { } } - if (!stuck_engaged && - jumpbug_apply(cmd, localIdx, ent, flags, vel, frametime)) + if (jumpbug_apply(cmd, localIdx, ent, flags, vel, frametime)) note_modified(cmd, flags, vel); bool melee = feature_active(FEAT_MELEE) && melee_weapon_active(ent); @@ -951,8 +866,6 @@ static void *setup_thread(void *) { toastf(TOAST_ERROR, "Netvars incomplete; features may be disabled"); else if (g_net.absvelocity < 0) toastf(TOAST_WARN, "Jumpbug assist disabled: velocity netvar missing"); - if (g_net.groundentity < 0) - toastf(TOAST_WARN, "Stucklaunch prop detection unavailable; bind it"); if (!g_iface.engineserver) toastf(TOAST_WARN, "Server interfaces missing; jumpbug/spread limited"); if (!g_iface.debugoverlay) -- cgit v1.2.3