diff options
Diffstat (limited to 'src/esp.cpp')
| -rw-r--r-- | src/esp.cpp | 52 |
1 files changed, 25 insertions, 27 deletions
diff --git a/src/esp.cpp b/src/esp.cpp index ec3e94b..50549a1 100644 --- a/src/esp.cpp +++ b/src/esp.cpp | |||
| @@ -208,7 +208,7 @@ static void esp_collect(int local_idx) { | |||
| 208 | g_net.modelindex >= 0 ? *(int *)(e + g_net.modelindex) : -1; | 208 | g_net.modelindex >= 0 ? *(int *)(e + g_net.modelindex) : -1; |
| 209 | int srv_mi = server_model_index(sbase); | 209 | int srv_mi = server_model_index(sbase); |
| 210 | srv_trusted = (cli_mi == srv_mi); | 210 | srv_trusted = (cli_mi == srv_mi); |
| 211 | logf("ESP server check: idx=%d base=%p cli_model=%d srv_model=%d " | 211 | logd("ESP server check: idx=%d base=%p cli_model=%d srv_model=%d " |
| 212 | "hp=%d maxhp=%d life=%d trusted=%d", | 212 | "hp=%d maxhp=%d life=%d trusted=%d", |
| 213 | idx, sbase, cli_mi, srv_mi, shp, smax, slife, (int)srv_trusted); | 213 | idx, sbase, cli_mi, srv_mi, shp, smax, slife, (int)srv_trusted); |
| 214 | if (!srv_trusted) | 214 | if (!srv_trusted) |
| @@ -223,7 +223,7 @@ static void esp_collect(int local_idx) { | |||
| 223 | 223 | ||
| 224 | if (dbg && npc && dbg_lines < 40) { | 224 | if (dbg && npc && dbg_lines < 40) { |
| 225 | dbg_lines++; | 225 | dbg_lines++; |
| 226 | logf("ESP npc %d cls=%s life=%d(cli %d) hp=%d(cli %d) maxhp=%d model=%s", | 226 | logd("ESP npc %d cls=%s life=%d(cli %d) hp=%d(cli %d) maxhp=%d model=%s", |
| 227 | idx, cls, life, cli_life, hp, cli_hp, maxhp, | 227 | idx, cls, life, cli_life, hp, cli_hp, maxhp, |
| 228 | model ? model : "?"); | 228 | model ? model : "?"); |
| 229 | } | 229 | } |
| @@ -266,10 +266,10 @@ static void esp_collect(int local_idx) { | |||
| 266 | } | 266 | } |
| 267 | 267 | ||
| 268 | if (dbg) | 268 | if (dbg) |
| 269 | logf("ESP scan: hi=%d npc_alive=%d targets=%d", hi, npc_alive, g_ntargets); | 269 | logd("ESP scan: hi=%d npc_alive=%d targets=%d", hi, npc_alive, g_ntargets); |
| 270 | if (g_ntargets && !g_esp_logged) { | 270 | if (g_ntargets && !g_esp_logged) { |
| 271 | g_esp_logged = true; | 271 | g_esp_logged = true; |
| 272 | logf("ESP: first targets, %d", g_ntargets); | 272 | logd("ESP: first targets, %d", g_ntargets); |
| 273 | } | 273 | } |
| 274 | } | 274 | } |
| 275 | 275 | ||
| @@ -442,7 +442,7 @@ static void draw_skeleton(const EspTarget &t) { | |||
| 442 | static int logged = 0; | 442 | static int logged = 0; |
| 443 | if (core_count > 0 && logged < 4) { | 443 | if (core_count > 0 && logged < 4) { |
| 444 | logged++; | 444 | logged++; |
| 445 | logf("skeleton: idx=%d bones=%d core=%d humanoid=%d", t.idx, n, core_count, | 445 | logd("skeleton: idx=%d bones=%d core=%d humanoid=%d", t.idx, n, core_count, |
| 446 | (int)bones_is_humanoid(t.idx)); | 446 | (int)bones_is_humanoid(t.idx)); |
| 447 | } | 447 | } |
| 448 | if (t.friendly) | 448 | if (t.friendly) |
| @@ -565,7 +565,7 @@ static bool select_aim_target(const QAngle &view, unsigned bone_mask, | |||
| 565 | static int lock_logs = 0; | 565 | static int lock_logs = 0; |
| 566 | if (lock_logs < 5) { | 566 | if (lock_logs < 5) { |
| 567 | lock_logs++; | 567 | lock_logs++; |
| 568 | logf("%s: lock idx=%d fov=%.2f", tag, out_idx, f); | 568 | logd("%s: lock idx=%d fov=%.2f", tag, out_idx, f); |
| 569 | } | 569 | } |
| 570 | return true; | 570 | return true; |
| 571 | } | 571 | } |
| @@ -636,7 +636,7 @@ static bool select_aim_target(const QAngle &view, unsigned bone_mask, | |||
| 636 | double now = esp_now(); | 636 | double now = esp_now(); |
| 637 | if (now - last_none >= 2.0) { | 637 | if (now - last_none >= 2.0) { |
| 638 | last_none = now; | 638 | last_none = now; |
| 639 | logf("%s: no hostile target within %.0f deg", tag, max_fov); | 639 | logd("%s: no hostile target within %.0f deg", tag, max_fov); |
| 640 | } | 640 | } |
| 641 | return false; | 641 | return false; |
| 642 | } | 642 | } |
| @@ -654,7 +654,7 @@ static bool select_aim_target(const QAngle &view, unsigned bone_mask, | |||
| 654 | static int sel_logs = 0; | 654 | static int sel_logs = 0; |
| 655 | if (sel_logs < 5) { | 655 | if (sel_logs < 5) { |
| 656 | sel_logs++; | 656 | sel_logs++; |
| 657 | logf("%s: target idx=%d fov=%.2f vischeck=%d", tag, out_idx, f, | 657 | logd("%s: target idx=%d fov=%.2f vischeck=%d", tag, out_idx, f, |
| 658 | (int)vischeck); | 658 | (int)vischeck); |
| 659 | } | 659 | } |
| 660 | return true; | 660 | return true; |
| @@ -664,7 +664,7 @@ static bool select_aim_target(const QAngle &view, unsigned bone_mask, | |||
| 664 | double now = esp_now(); | 664 | double now = esp_now(); |
| 665 | if (now - last_vis >= 2.0) { | 665 | if (now - last_vis >= 2.0) { |
| 666 | last_vis = now; | 666 | last_vis = now; |
| 667 | logf("%s: no visible aim point (vischeck=%d)", tag, (int)vischeck); | 667 | logd("%s: no visible aim point (vischeck=%d)", tag, (int)vischeck); |
| 668 | } | 668 | } |
| 669 | return false; | 669 | return false; |
| 670 | } | 670 | } |
| @@ -688,7 +688,7 @@ bool aimbot_apply(CUserCmd *cmd) { | |||
| 688 | static int want_logs = 0; | 688 | static int want_logs = 0; |
| 689 | if (want_logs < 10) { | 689 | if (want_logs < 10) { |
| 690 | want_logs++; | 690 | want_logs++; |
| 691 | logf("aimbot: target=%d aim=(%.1f %.1f %.1f) fov=%.2f want=%.2f/%.2f", | 691 | logd("aimbot: target=%d aim=(%.1f %.1f %.1f) fov=%.2f want=%.2f/%.2f", |
| 692 | target, point.x, point.y, point.z, fov, desired.x, desired.y); | 692 | target, point.x, point.y, point.z, fov, desired.x, desired.y); |
| 693 | } | 693 | } |
| 694 | float dp = desired.x - cmd->viewangles[0]; | 694 | float dp = desired.x - cmd->viewangles[0]; |
| @@ -723,7 +723,7 @@ bool aimbot_apply(CUserCmd *cmd) { | |||
| 723 | static int mod_logs = 0; | 723 | static int mod_logs = 0; |
| 724 | if (mod_logs < 10) { | 724 | if (mod_logs < 10) { |
| 725 | mod_logs++; | 725 | mod_logs++; |
| 726 | logf("aimbot: view %.2f/%.2f -> %.2f/%.2f", old_pitch, old_yaw, np, ny); | 726 | logd("aimbot: view %.2f/%.2f -> %.2f/%.2f", old_pitch, old_yaw, np, ny); |
| 727 | } | 727 | } |
| 728 | return true; | 728 | return true; |
| 729 | } | 729 | } |
| @@ -785,7 +785,7 @@ bool silent_aim_apply(CUserCmd *cmd) { | |||
| 785 | static int logs = 0; | 785 | static int logs = 0; |
| 786 | if (logs < 5) { | 786 | if (logs < 5) { |
| 787 | logs++; | 787 | logs++; |
| 788 | logf("silentaim: fire idx=%d fov=%.2f aim=%.2f/%.2f", target, fov, np, ny); | 788 | logd("silentaim: fire idx=%d fov=%.2f aim=%.2f/%.2f", target, fov, np, ny); |
| 789 | } | 789 | } |
| 790 | return true; | 790 | return true; |
| 791 | } | 791 | } |
| @@ -855,7 +855,7 @@ bool melee_weapon_active(void *local_ent) { | |||
| 855 | if (idx != last_idx || crowbar != last_crowbar) { | 855 | if (idx != last_idx || crowbar != last_crowbar) { |
| 856 | last_idx = idx; | 856 | last_idx = idx; |
| 857 | last_crowbar = crowbar; | 857 | last_crowbar = crowbar; |
| 858 | logf("melee: active idx=%d cls=%s model=%s crowbar=%d", idx, | 858 | logd("melee: active idx=%d cls=%s model=%s crowbar=%d", idx, |
| 859 | cls ? cls : "?", model ? model : "?", (int)crowbar); | 859 | cls ? cls : "?", model ? model : "?", (int)crowbar); |
| 860 | } | 860 | } |
| 861 | return crowbar; | 861 | return crowbar; |
| @@ -1033,7 +1033,7 @@ bool melee_aimbot_apply(CUserCmd *cmd) { | |||
| 1033 | static int logs = 0; | 1033 | static int logs = 0; |
| 1034 | if (logs < 10) { | 1034 | if (logs < 10) { |
| 1035 | logs++; | 1035 | logs++; |
| 1036 | logf("melee: swing idx=%d dist=%.1f aim=(%.1f %.1f %.1f)", c.idx, | 1036 | logd("melee: swing idx=%d dist=%.1f aim=(%.1f %.1f %.1f)", c.idx, |
| 1037 | c.dist, aim.x, aim.y, aim.z); | 1037 | c.dist, aim.x, aim.y, aim.z); |
| 1038 | } | 1038 | } |
| 1039 | return true; | 1039 | return true; |
| @@ -1043,7 +1043,7 @@ bool melee_aimbot_apply(CUserCmd *cmd) { | |||
| 1043 | double now = esp_now(); | 1043 | double now = esp_now(); |
| 1044 | if (now - last_none >= 2.0) { | 1044 | if (now - last_none >= 2.0) { |
| 1045 | last_none = now; | 1045 | last_none = now; |
| 1046 | logf("melee: no visible target within %.0f", MELEE_RANGE); | 1046 | logd("melee: no visible target within %.0f", MELEE_RANGE); |
| 1047 | } | 1047 | } |
| 1048 | return false; | 1048 | return false; |
| 1049 | } | 1049 | } |
| @@ -1132,7 +1132,7 @@ static void spread_compute() { | |||
| 1132 | g_spread_seed12 = window(12, 0); | 1132 | g_spread_seed12 = window(12, 0); |
| 1133 | seed(0); | 1133 | seed(0); |
| 1134 | 1134 | ||
| 1135 | logf("spread: seeds single=%d shotgun8=%d shotgun12=%d", g_spread_seed1, | 1135 | logd("spread: seeds single=%d shotgun8=%d shotgun12=%d", g_spread_seed1, |
| 1136 | g_spread_seed8, g_spread_seed12); | 1136 | g_spread_seed8, g_spread_seed12); |
| 1137 | g_spread_ready = true; | 1137 | g_spread_ready = true; |
| 1138 | } | 1138 | } |
| @@ -1182,7 +1182,7 @@ bool spread_control_apply(CUserCmd *cmd, void *local_ent) { | |||
| 1182 | static int logs = 0; | 1182 | static int logs = 0; |
| 1183 | if (logs < 10) { | 1183 | if (logs < 10) { |
| 1184 | logs++; | 1184 | logs++; |
| 1185 | logf("spread: seed=%d pellets=%d", seed, pellets); | 1185 | logd("spread: seed=%d pellets=%d", seed, pellets); |
| 1186 | } | 1186 | } |
| 1187 | return true; | 1187 | return true; |
| 1188 | } | 1188 | } |
| @@ -1243,7 +1243,7 @@ bool triggerbot_apply(CUserCmd *cmd) { | |||
| 1243 | static int logs = 0; | 1243 | static int logs = 0; |
| 1244 | if (logs < 5) { | 1244 | if (logs < 5) { |
| 1245 | logs++; | 1245 | logs++; |
| 1246 | logf("triggerbot: fire idx=%d model=%s", idx, model ? model : "?"); | 1246 | logd("triggerbot: fire idx=%d model=%s", idx, model ? model : "?"); |
| 1247 | } | 1247 | } |
| 1248 | return true; | 1248 | return true; |
| 1249 | } | 1249 | } |
| @@ -1255,7 +1255,7 @@ void esp_draw() { | |||
| 1255 | if (!g_scr_w) { | 1255 | if (!g_scr_w) { |
| 1256 | using Fn = void (*)(void *, int &, int &); | 1256 | using Fn = void (*)(void *, int &, int &); |
| 1257 | vfunc<Fn>(g_surface, SURF_GetScreenSize)(g_surface, g_scr_w, g_scr_h); | 1257 | vfunc<Fn>(g_surface, SURF_GetScreenSize)(g_surface, g_scr_w, g_scr_h); |
| 1258 | logf("ESP: screen %dx%d", g_scr_w, g_scr_h); | 1258 | logd("ESP: screen %dx%d", g_scr_w, g_scr_h); |
| 1259 | if (!g_scr_w) return; | 1259 | if (!g_scr_w) return; |
| 1260 | } | 1260 | } |
| 1261 | draw_fov_circle(); | 1261 | draw_fov_circle(); |
| @@ -1323,7 +1323,7 @@ void esp_draw() { | |||
| 1323 | static int no_head = 0; | 1323 | static int no_head = 0; |
| 1324 | if (no_head < 4) { | 1324 | if (no_head < 4) { |
| 1325 | no_head++; | 1325 | no_head++; |
| 1326 | logf("head: idx=%d no head hitbox/bone", t.idx); | 1326 | logd("head: idx=%d no head hitbox/bone", t.idx); |
| 1327 | } | 1327 | } |
| 1328 | continue; | 1328 | continue; |
| 1329 | } | 1329 | } |
| @@ -1334,7 +1334,7 @@ void esp_draw() { | |||
| 1334 | surf_rect(1, (int)hx - 2, (int)hy - 2, (int)hx + 3, (int)hy + 3); | 1334 | surf_rect(1, (int)hx - 2, (int)hy - 2, (int)hx + 3, (int)hy + 3); |
| 1335 | if (!head_logged) { | 1335 | if (!head_logged) { |
| 1336 | head_logged = true; | 1336 | head_logged = true; |
| 1337 | logf("bone debug: idx=%d bones=%d head=(%.1f %.1f %.1f)", t.idx, | 1337 | logd("bone debug: idx=%d bones=%d head=(%.1f %.1f %.1f)", t.idx, |
| 1338 | bones_count(t.idx), head.x, head.y, head.z); | 1338 | bones_count(t.idx), head.x, head.y, head.z); |
| 1339 | } | 1339 | } |
| 1340 | } | 1340 | } |
| @@ -1700,7 +1700,7 @@ static void items_collect(int local_idx) { | |||
| 1700 | 1700 | ||
| 1701 | if (propish && dist < 1500.0f && prop_logs < 40) { | 1701 | if (propish && dist < 1500.0f && prop_logs < 40) { |
| 1702 | prop_logs++; | 1702 | prop_logs++; |
| 1703 | logf("item prop: idx=%d cls=%s model=%s kind=%d dist=%.0f " | 1703 | logd("item prop: idx=%d cls=%s model=%s kind=%d dist=%.0f " |
| 1704 | "origin=(%.0f %.0f %.0f)", | 1704 | "origin=(%.0f %.0f %.0f)", |
| 1705 | idx, cls ? cls : "?", model ? model : "?", kind, dist, origin.x, | 1705 | idx, cls ? cls : "?", model ? model : "?", kind, dist, origin.x, |
| 1706 | origin.y, origin.z); | 1706 | origin.y, origin.z); |
| @@ -1721,10 +1721,8 @@ static void items_collect(int local_idx) { | |||
| 1721 | if (idx == active_idx || item_weapon_is_owned(ent)) | 1721 | if (idx == active_idx || item_weapon_is_owned(ent)) |
| 1722 | continue; | 1722 | continue; |
| 1723 | } | 1723 | } |
| 1724 | // Crates are rare and always worth knowing about; the distance slider | 1724 | // Distance applies to every tag, including supply crates. |
| 1725 | // filters the common ammo/health clutter. | 1725 | if (g_item_max_dist > 0 && dist > (float)g_item_max_dist) |
| 1726 | if (kind != IK_CRATE && g_item_max_dist > 0 && | ||
| 1727 | dist > (float)g_item_max_dist) | ||
| 1728 | continue; | 1726 | continue; |
| 1729 | 1727 | ||
| 1730 | ItemTarget &t = g_item_targets[g_nitems++]; | 1728 | ItemTarget &t = g_item_targets[g_nitems++]; |
| @@ -1734,7 +1732,7 @@ static void items_collect(int local_idx) { | |||
| 1734 | snprintf(t.label, sizeof(t.label), "%s", label); | 1732 | snprintf(t.label, sizeof(t.label), "%s", label); |
| 1735 | if (dbg_lines < 8) { | 1733 | if (dbg_lines < 8) { |
| 1736 | dbg_lines++; | 1734 | dbg_lines++; |
| 1737 | logf("item: idx=%d kind=%d cls=%s model=%s", idx, kind, | 1735 | logd("item: idx=%d kind=%d cls=%s model=%s", idx, kind, |
| 1738 | cls ? cls : "?", model ? model : "?"); | 1736 | cls ? cls : "?", model ? model : "?"); |
| 1739 | } | 1737 | } |
| 1740 | } | 1738 | } |
