diff options
Diffstat (limited to '')
| -rw-r--r-- | src/bones.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/bones.cpp b/src/bones.cpp index f33a4b2..abcaac6 100644 --- a/src/bones.cpp +++ b/src/bones.cpp | |||
| @@ -439,6 +439,12 @@ bool head_position(int idx, Vector &out) { | |||
| 439 | const HitboxSet *s = hitbox_set0(e->hdr); | 439 | const HitboxSet *s = hitbox_set0(e->hdr); |
| 440 | if (s) { | 440 | if (s) { |
| 441 | const Hitbox *boxes = hitboxes(s); | 441 | const Hitbox *boxes = hitboxes(s); |
| 442 | // HITGROUP_HEAD == 1. HL2 models often have no hitbox names, so use the | ||
| 443 | // damage-group head hitbox first (zombie: headcrab body, humanoids: head). | ||
| 444 | for (int i = 0; i < s->numhitboxes; i++) { | ||
| 445 | if (boxes[i].group == 1 && hitbox_world(e, boxes[i], out)) | ||
| 446 | return true; | ||
| 447 | } | ||
| 442 | for (int i = 0; i < s->numhitboxes; i++) { | 448 | for (int i = 0; i < s->numhitboxes; i++) { |
| 443 | if (boxes[i].bone < 0 || boxes[i].bone >= e->count) | 449 | if (boxes[i].bone < 0 || boxes[i].bone >= e->count) |
| 444 | continue; | 450 | continue; |
