From 15994ed04ef0e5eade0bcf8ce65142e184446ffb Mon Sep 17 00:00:00 2001 From: michael Date: Sat, 3 Oct 2026 14:52:21 -0400 Subject: [PATCH] =?UTF-8?q?debug:=20sample=20per-candidate=20distances=20w?= =?UTF-8?q?hen=20filter=20matches=20but=20nothing=20within=20OMNI=5FHACK?= =?UTF-8?q?=5FRANGE=20(measured:=20enemies=3D8-10=20yet=20selected=3Dnil?= =?UTF-8?q?=20all=20mission=20=E2=80=94=20suspect=20NaN/long=20distances?= =?UTF-8?q?=20from=20position=20reads)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AutoMark/scripts/mods/AutoMark/mark/servo_skull_mark.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/AutoMark/scripts/mods/AutoMark/mark/servo_skull_mark.lua b/AutoMark/scripts/mods/AutoMark/mark/servo_skull_mark.lua index a67b9d0..c4f7bad 100644 --- a/AutoMark/scripts/mods/AutoMark/mark/servo_skull_mark.lua +++ b/AutoMark/scripts/mods/AutoMark/mark/servo_skull_mark.lua @@ -240,6 +240,7 @@ local function find_hackable_target_unit_omni() if mod_settings.debug_mode then diag_total = 0 end + local diag_samples = mod_settings.debug_mode and {} or nil for unit, target_extension in pairs(smart_tag_system._unit_extension_data) do if unit ~= player_unit and HEALTH_ALIVE[unit] and target_extension._target_type == "breed" and not mod._hack_blacklist[unit] then local unit_data_extension = ScriptUnit_extension(unit, "unit_data_system") @@ -249,6 +250,9 @@ local function find_hackable_target_unit_omni() diag_total = diag_total + 1 end local distance = Vector3_distance(Unit_world_position(unit, 1), player_position) + if diag_samples and #diag_samples < 10 then + diag_samples[#diag_samples + 1] = breed_data.name .. "=" .. tostring(distance) + end if distance <= OMNI_HACK_RANGE and (not selected_distance or distance < selected_distance) then selected_unit, selected_distance = unit, distance end @@ -260,6 +264,9 @@ local function find_hackable_target_unit_omni() if mod.omni_hack_diag_counter % 10 == 1 then mod:diag(string.format("OMNI-HACK-DIAG enemies=%d selected=%s dist=%s", diag_total, tostring(selected_unit), tostring(selected_distance))) end + if not selected_unit and diag_total > 0 and mod.omni_hack_diag_counter % 50 == 1 then + mod:diag("OMNI-HACK-DIAG no-selection samples: " .. table.concat(diag_samples, " ")) + end end if selected_unit then -- don't retarget the same unit forever if the game refuses to accept the tag