From ac578cd21c5f05ebdb6647d595b5bdf5aeefd598 Mon Sep 17 00:00:00 2001 From: salmonik Date: Mon, 26 Oct 2026 16:29:10 +0100 Subject: ESP: include zombie head (headcrab body/head) in humanoid skeleton --- src/bones.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/bones.cpp b/src/bones.cpp index 35756c2..d1e25cb 100644 --- a/src/bones.cpp +++ b/src/bones.cpp @@ -209,15 +209,32 @@ static void build_core_mask(BoneEntry *e) { int b = boxes[i].bone; if (b < 0 || b >= e->count) continue; + bool is_head = (boxes[i].group == 1); // HITGROUP_HEAD const char *bn = bone_name_raw(e->hdr, b); - if (bn && (contains_ci(bn, "Headcrab") || contains_ci(bn, "HC_") || - contains_ci(bn, "Finger") || contains_ci(bn, "Toe"))) + if (bn && (contains_ci(bn, "Finger") || contains_ci(bn, "Toe"))) + continue; + // A zombie's "head" is the headcrab body (HC_Body_Bone); let the head + // hitbox through even though its name is HC_*, but keep the headcrab's + // extra limbs out. + if (!is_head && bn && + (contains_ci(bn, "Headcrab") || contains_ci(bn, "HC_"))) continue; int cur = b; for (int guard = 0; cur >= 0 && cur < e->count && guard < 64; guard++) { e->core[cur] = true; cur = bone_at(e->hdr, cur)->parent; } + // Include a direct "head" child of the head bone (zombie: HC_Head_Bone + // hanging off HC_Body_Bone). + if (is_head) { + for (int c = 0; c < e->count; c++) { + if (bone_at(e->hdr, c)->parent != b) + continue; + const char *cn = bone_name_raw(e->hdr, c); + if (cn && contains_ci(cn, "Head")) + e->core[c] = true; + } + } } } -- cgit v1.2.3