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/bones.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/bones.cpp') diff --git a/src/bones.cpp b/src/bones.cpp index 0df13f2..c777067 100644 --- a/src/bones.cpp +++ b/src/bones.cpp @@ -509,6 +509,19 @@ bool head_position(int idx, Vector &out) { // Collect world-space aim points for the selected hit groups (HITGROUP_*). // Group 1 (head) uses head_position for its bone fallback; other groups are // the hitbox centers. The caller picks the point nearest to the crosshair. +void bones_clear() { + for (auto &e : g_entries) { + e.ent = nullptr; + e.valid = false; + e.hdr = nullptr; + e.count = 0; + e.stamp = 0.0; + } + g_next = 0; + g_logged = 0; + g_renderable_warned = false; +} + int aim_points(int idx, unsigned group_mask, Vector *out, int max) { if (!out || max <= 0) return 0; -- cgit v1.2.3