diff options
Diffstat (limited to '')
| -rw-r--r-- | src/bones.cpp | 13 | ||||
| -rw-r--r-- | src/esp.cpp | 3 | ||||
| -rw-r--r-- | src/hl2h.h | 1 |
3 files changed, 14 insertions, 3 deletions
diff --git a/src/bones.cpp b/src/bones.cpp index d1e25cb..f33a4b2 100644 --- a/src/bones.cpp +++ b/src/bones.cpp | |||
| @@ -371,16 +371,20 @@ int bone_parent(int idx, int bone) { | |||
| 371 | 371 | ||
| 372 | bool bone_is_skeleton_core(int idx, int bone) { | 372 | bool bone_is_skeleton_core(int idx, int bone) { |
| 373 | BoneEntry *e = find_entry(idx); | 373 | BoneEntry *e = find_entry(idx); |
| 374 | if (!e || !e->valid || !e->humanoid || bone < 0 || bone >= e->count) | 374 | if (!e || !e->valid || bone < 0 || bone >= e->count) |
| 375 | return false; | 375 | return false; |
| 376 | if (!e->humanoid) | ||
| 377 | return true; // non-humanoid: draw its full bone tree | ||
| 376 | return e->core[bone]; | 378 | return e->core[bone]; |
| 377 | } | 379 | } |
| 378 | 380 | ||
| 379 | int bone_nearest_core_parent(int idx, int bone) { | 381 | int bone_nearest_core_parent(int idx, int bone) { |
| 380 | BoneEntry *e = find_entry(idx); | 382 | BoneEntry *e = find_entry(idx); |
| 381 | if (!e || !e->valid || !e->humanoid || bone < 0 || bone >= e->count) | 383 | if (!e || !e->valid || bone < 0 || bone >= e->count) |
| 382 | return -1; | 384 | return -1; |
| 383 | int p = bone_at(e->hdr, bone)->parent; | 385 | int p = bone_at(e->hdr, bone)->parent; |
| 386 | if (!e->humanoid) | ||
| 387 | return (p >= 0 && p < e->count) ? p : -1; | ||
| 384 | for (int guard = 0; p >= 0 && p < e->count && guard < 64; guard++) { | 388 | for (int guard = 0; p >= 0 && p < e->count && guard < 64; guard++) { |
| 385 | if (e->core[p]) | 389 | if (e->core[p]) |
| 386 | return p; | 390 | return p; |
| @@ -389,6 +393,11 @@ int bone_nearest_core_parent(int idx, int bone) { | |||
| 389 | return -1; | 393 | return -1; |
| 390 | } | 394 | } |
| 391 | 395 | ||
| 396 | bool bones_is_humanoid(int idx) { | ||
| 397 | BoneEntry *e = find_entry(idx); | ||
| 398 | return e && e->valid && e->humanoid; | ||
| 399 | } | ||
| 400 | |||
| 392 | bool bone_pos(int idx, int bone, Vector &out) { | 401 | bool bone_pos(int idx, int bone, Vector &out) { |
| 393 | BoneEntry *e = find_entry(idx); | 402 | BoneEntry *e = find_entry(idx); |
| 394 | if (!e || !e->valid || bone < 0 || bone >= e->count) | 403 | if (!e || !e->valid || bone < 0 || bone >= e->count) |
diff --git a/src/esp.cpp b/src/esp.cpp index b5cb9b0..34a702a 100644 --- a/src/esp.cpp +++ b/src/esp.cpp | |||
| @@ -298,7 +298,8 @@ static void draw_skeleton(const EspTarget &t) { | |||
| 298 | static int logged = 0; | 298 | static int logged = 0; |
| 299 | if (core_count > 0 && logged < 4) { | 299 | if (core_count > 0 && logged < 4) { |
| 300 | logged++; | 300 | logged++; |
| 301 | logf("skeleton: idx=%d bones=%d core=%d", t.idx, n, core_count); | 301 | logf("skeleton: idx=%d bones=%d core=%d humanoid=%d", t.idx, n, core_count, |
| 302 | (int)bones_is_humanoid(t.idx)); | ||
| 302 | } | 303 | } |
| 303 | if (t.friendly) | 304 | if (t.friendly) |
| 304 | surf_color(60, 255, 60, 255); | 305 | surf_color(60, 255, 60, 255); |
| @@ -177,6 +177,7 @@ int bone_parent(int idx, int bone); | |||
| 177 | bool bone_pos(int idx, int bone, Vector &out); | 177 | bool bone_pos(int idx, int bone, Vector &out); |
| 178 | bool bone_is_skeleton_core(int idx, int bone); | 178 | bool bone_is_skeleton_core(int idx, int bone); |
| 179 | int bone_nearest_core_parent(int idx, int bone); | 179 | int bone_nearest_core_parent(int idx, int bone); |
| 180 | bool bones_is_humanoid(int idx); | ||
| 180 | bool hitbox_center(int idx, const char *hitbox_name, Vector &out); | 181 | bool hitbox_center(int idx, const char *hitbox_name, Vector &out); |
| 181 | bool head_position(int idx, Vector &out); | 182 | bool head_position(int idx, Vector &out); |
| 182 | 183 | ||
