diff --git a/AutoMark/scripts/mods/AutoMark/mark/servo_skull_mark.lua b/AutoMark/scripts/mods/AutoMark/mark/servo_skull_mark.lua index 9321672..a66c9b6 100644 --- a/AutoMark/scripts/mods/AutoMark/mark/servo_skull_mark.lua +++ b/AutoMark/scripts/mods/AutoMark/mark/servo_skull_mark.lua @@ -54,6 +54,11 @@ local function ensure_automark_tag_hook() -- runs inside this window. local patched = {} patched.set_tag = function(self, template_name, tagger_unit, target_unit, target_location) + if template_name == HACK_TAG_NAME and mod_settings.debug_mode and not mod.omni_hack_wrapper_seen then + mod.omni_hack_wrapper_seen = true + local ext = target_unit and self._unit_extension_data[target_unit] + mod:diag("OMNI-HACK-DIAG wrapper-hack is_server=", tostring(self._is_server), " self_is_sys=", tostring(self == smart_tag_system), " flagged=", tostring(ext and ext._automark_hack_order), " has_ext=", tostring(ext ~= nil)) + end if self == smart_tag_system and target_unit and self._is_server and not patched.in_branch and template_name == HACK_TAG_NAME then local target_extension = self._unit_extension_data[target_unit] if target_extension and target_extension._automark_hack_order then diff --git a/AutoMark/scripts/mods/AutoMark/targeting/custom_targeting.lua b/AutoMark/scripts/mods/AutoMark/targeting/custom_targeting.lua index b46f93b..ba7139d 100644 --- a/AutoMark/scripts/mods/AutoMark/targeting/custom_targeting.lua +++ b/AutoMark/scripts/mods/AutoMark/targeting/custom_targeting.lua @@ -805,11 +805,25 @@ function mod:find_auto_mark_target_unit(min_range, max_range, tag_name, tag_cont omni_reject("companion_invalid") goto continue end - elseif tag_name == TAG_NAMES.SERVO_SKULL_TAG then - if not is_servo_skull_tag_target_valid(hit_unit, hit_unit_tag, hit_unit_breed_name, hit_unit_breed_data, hit_unit_attacking_unit_id, game_session, removed_units, companion_position, hit_unit_center_pos, max_ability_charges, remaining_capacitance) then - omni_reject("skull_invalid") - goto continue - end +elseif tag_name == TAG_NAMES.SERVO_SKULL_TAG then + if not is_servo_skull_tag_target_valid(hit_unit, hit_unit_tag, hit_unit_breed_name, hit_unit_breed_data, hit_unit_attacking_unit_id, game_session, removed_units, companion_position, hit_unit_center_pos, max_ability_charges, remaining_capacitance) then + if omni_rejects then + local sub + if hit_unit_tag and hit_unit_tag._template and hit_unit_tag._template.name == TAG_NAMES.VETERAN_TAG then + sub = "vet_conflict" + elseif mod_settings.servo_skull_mark_ignore_unaggroed and hit_unit_attacking_unit_id == -1 then + sub = "unaggroed" + elseif not mod:has_enough_capacitance(hit_unit) then + sub = "capacitance" + else + sub = "range" + end + omni_reject("skull:" .. sub) + else + omni_reject("skull_invalid") + end + goto continue + end end local visible