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