fix: route OMNI/HACK diagnostics through raw engine printf — DMF :info also fires on-screen notifications and spammed chat

This commit is contained in:
2026-10-03 14:10:07 -04:00
parent 0ba1d73ba4
commit b16a9cc8df
2 changed files with 7 additions and 7 deletions
@@ -245,9 +245,9 @@ local function find_hackable_target_unit_omni()
end
parts[#parts + 1] = tostring(k) .. "=" .. vs
end
mod:info("OMNI-HACK-DIAG template: " .. table.concat(parts, " "))
printf("[MOD][AutoMark][DIAG] %s", "OMNI-HACK-DIAG template: " .. table.concat(parts, " "))
else
mod:info("OMNI-HACK-DIAG template missing: " .. tostring(tpl))
printf("[MOD][AutoMark][DIAG] %s", "OMNI-HACK-DIAG template missing: " .. tostring(tpl))
end
else
local keys = {}
@@ -255,7 +255,7 @@ local function find_hackable_target_unit_omni()
keys[#keys + 1] = tostring(k)
end
table.sort(keys)
mod:info("OMNI-HACK-DIAG no templates table, system keys: " .. table.concat(keys, ","))
printf("[MOD][AutoMark][DIAG] %s", "OMNI-HACK-DIAG no templates table, system keys: " .. table.concat(keys, ","))
end
end
@@ -285,7 +285,7 @@ local function find_hackable_target_unit_omni()
if diag_total then
mod.omni_hack_diag_counter = (mod.omni_hack_diag_counter or 0) + 1
if mod.omni_hack_diag_counter % 10 == 1 then
mod:info(string.format("OMNI-HACK-DIAG breed_units=%d hackable=%d selected=%s dist=%s", diag_total, diag_hackable, tostring(selected_unit), tostring(selected_distance)))
printf("[MOD][AutoMark][DIAG] %s", string.format("OMNI-HACK-DIAG breed_units=%d hackable=%d selected=%s dist=%s", diag_total, diag_hackable, tostring(selected_unit), tostring(selected_distance)))
end
end
return selected_unit, selected_distance
@@ -588,7 +588,7 @@ function mod:find_auto_mark_target_unit(min_range, max_range, tag_name, tag_cont
local omni_mark = mod_settings.omni_mark
if mod_settings.debug_mode and not mod.omni_diag_settings_logged then
mod.omni_diag_settings_logged = true
mod:info(string.format("OMNI-DIAG settings: omni_mark=%s ignore_los=%s debug=%s", tostring(omni_mark), tostring(mod_settings.omni_mark_ignore_los), tostring(mod_settings.debug_mode)))
printf("[MOD][AutoMark][DIAG] %s", string.format("OMNI-DIAG settings: omni_mark=%s ignore_los=%s debug=%s", tostring(omni_mark), tostring(mod_settings.omni_mark_ignore_los), tostring(mod_settings.debug_mode)))
end
local ray_origin, forward, right, up = smart_targeting_extension:_targeting_parameters()
local hits, num_hits, hits_are_units
@@ -628,7 +628,7 @@ function mod:find_auto_mark_target_unit(min_range, max_range, tag_name, tag_cont
for _, n in ipairs(ordered_names) do
name_parts[#name_parts + 1] = n .. "x" .. counts[n]
end
mod:info(string.format("OMNI-DIAG candidates=%d breeds=[%s]", num_hits, table.concat(name_parts, ",")))
printf("[MOD][AutoMark][DIAG] %s", string.format("OMNI-DIAG candidates=%d breeds=[%s]", num_hits, table.concat(name_parts, ",")))
end
else
hits, num_hits = PhysicsWorld_raycast(smart_targeting_extension._physics_world, ray_origin, forward, max_range, "all", "collision_filter", COLLISION_FILTER)
@@ -849,7 +849,7 @@ function mod:find_auto_mark_target_unit(min_range, max_range, tag_name, tag_cont
parts[#parts + 1] = k .. "=" .. v
end
table.sort(parts)
mod:info(string.format("OMNI-DIAG pass[%s] best=%s rejects=[%s]", tostring(tag_name), tostring(best_unit_breed_name), table.concat(parts, ",")))
printf("[MOD][AutoMark][DIAG] %s", string.format("OMNI-DIAG pass[%s] best=%s rejects=[%s]", tostring(tag_name), tostring(best_unit_breed_name), table.concat(parts, ",")))
omni_rejects = nil
end