From 2eda18951fde7ebd803aeb48595f203c0bb2f82a Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 28 Oct 2026 12:42:46 +0100 Subject: Item ESP: make 0 = unlimited explicit and persistent - config_load now accepts max_dist=0 instead of clamping it to 250, so the "unlimited" setting survives a restart. - The Max distance slider shows "All" at 0 and its tooltip documents 0 = unlimited; the categories log prints max=All. - Skip unclassified entities before projecting them / computing distance. - Keep the removed prop/crate debug logging and the user's rule that the distance slider applies to every tag. --- src/esp.cpp | 41 +++++++++-------------------------------- 1 file changed, 9 insertions(+), 32 deletions(-) (limited to 'src/esp.cpp') diff --git a/src/esp.cpp b/src/esp.cpp index 50549a1..4d2345d 100644 --- a/src/esp.cpp +++ b/src/esp.cpp @@ -1644,15 +1644,18 @@ static void items_collect(int local_idx) { static bool cats_logged = false; if (!cats_logged) { cats_logged = true; + char maxbuf[16]; + if (g_item_max_dist == 0) + snprintf(maxbuf, sizeof(maxbuf), "All"); + else + snprintf(maxbuf, sizeof(maxbuf), "%d", g_item_max_dist); logf("items: categories health=%d ammo=%d armor=%d weapons=%d " - "crates=%d distance=%d max=%d", + "crates=%d distance=%d max=%s", (int)g_item_health, (int)g_item_ammo, (int)g_item_armor, (int)g_item_weapons, (int)g_item_crates, (int)g_item_distance, - g_item_max_dist); + maxbuf); } static int dbg_lines = 0; - static int prop_logs = 0; - static int crate_logs = 0; static bool owner_warned = false; if (!owner_warned && g_net.owner < 0 && g_net.weapon_owner < 0) { owner_warned = true; @@ -1680,14 +1683,7 @@ static void items_collect(int local_idx) { } char label[128]; int kind = classify_item(model, cls, label, sizeof(label)); - - bool propish = item_icontains(cls, "crate") || - item_icontains(model, "crate") || - item_icontains(cls, "physicsprop") || - item_icontains(cls, "breakableprop") || - item_icontains(cls, "func_breakable") || - item_icontains(cls, "physbox"); - if (kind < 0 && !propish) + if (kind < 0) continue; Vector origin{*(float *)((uintptr_t)ent + g_net.origin), @@ -1698,30 +1694,11 @@ static void items_collect(int local_idx) { float dz = origin.z - g_cam_eye.z; float dist = sqrtf(dx * dx + dy * dy + dz * dz); - if (propish && dist < 1500.0f && prop_logs < 40) { - prop_logs++; - logd("item prop: idx=%d cls=%s model=%s kind=%d dist=%.0f " - "origin=(%.0f %.0f %.0f)", - idx, cls ? cls : "?", model ? model : "?", kind, dist, origin.x, - origin.y, origin.z); - } - bool crateish = item_icontains(cls, "crate") || - item_icontains(model, "crate"); - if (crateish && dist < 1500.0f && crate_logs < 40) { - crate_logs++; - logf("item crate seen: idx=%d cls=%s model=%s kind=%d dist=%.0f " - "origin=(%.0f %.0f %.0f)", - idx, cls ? cls : "?", model ? model : "?", kind, dist, origin.x, - origin.y, origin.z); - } - if (kind < 0) - continue; - if (kind == IK_WEAPON) { if (idx == active_idx || item_weapon_is_owned(ent)) continue; } - // Distance applies to every tag, including supply crates. + // Distance applies to every tag; 0 means unlimited. if (g_item_max_dist > 0 && dist > (float)g_item_max_dist) continue; -- cgit v1.2.3