From b212e8e13835cfdc4849a61c1b57146bd0312a29 Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 28 Oct 2026 13:02:26 +0100 Subject: Melee: surface weapon state across maps; reset stale caches - Map transitions often leave a non-crowbar weapon active, so the killbot silently does nothing. Log every active-weapon change as a normal `melee: active ... crowbar=0/1` line and toast once suggesting the crowbar. - Recover the crowbar model from the server entity when the client weapon model index is missing/0 after a map change. - Clear the bone cache and aim/silent locks when the local player entity changes (map load/respawn) so stale entity/model data cannot poison melee target selection. --- src/hl2h.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/hl2h.cpp') diff --git a/src/hl2h.cpp b/src/hl2h.cpp index 4f5673f..f95f6ed 100644 --- a/src/hl2h.cpp +++ b/src/hl2h.cpp @@ -556,6 +556,15 @@ static void do_move(int seq, float frametime) { if (!ent) return; + // New map / respawn: drop stale bone caches and target locks. + static void *last_local_ent = nullptr; + if (ent != last_local_ent) { + last_local_ent = ent; + bones_clear(); + aimbot_reset_lock(); + silentaim_reset_lock(); + } + if (feature_active(FEAT_SPREAD)) { resolve_server_netvars(); void *srv = nullptr; -- cgit v1.2.3