From eb8b178a0f047da0ecfa9d6e21d99b49c9049310 Mon Sep 17 00:00:00 2001 From: michael Date: Sat, 3 Oct 2026 17:32:36 -0400 Subject: [PATCH] =?UTF-8?q?fix:=20release=20auto-mark=20tag=20the=20moment?= =?UTF-8?q?=20the=20marked=20target=20dies=20=E2=80=94=20vanilla=20keeps?= =?UTF-8?q?=20it=20until=20corpse=20despawn=20(skull=20shoot=20tag=20lifet?= =?UTF-8?q?ime=20is=2025s)=20which=20starves=20mark=5Flimit=20and=20produc?= =?UTF-8?q?ed=20the=20post-kill=20dead=20zone;=20cancel=5Ftag=20+=20cooldo?= =?UTF-8?q?wn=20reset=20now,=20next=20tick=20re-marks=20within=200.2s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AutoMark/scripts/mods/AutoMark/AutoMark.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/AutoMark/scripts/mods/AutoMark/AutoMark.lua b/AutoMark/scripts/mods/AutoMark/AutoMark.lua index a462236..6c72d2c 100644 --- a/AutoMark/scripts/mods/AutoMark/AutoMark.lua +++ b/AutoMark/scripts/mods/AutoMark/AutoMark.lua @@ -494,6 +494,21 @@ local function auto_mark_by_tag(tag_name, t, fixed_frame) local disabled_character_state_component = context.disabled_character_state_component local is_character_disabled = disabled_character_state_component and disabled_character_state_component.is_disabled and DISABLING_TYPES[disabled_character_state_component.disabling_type] local target_unit, target_tag, target_is_dormant_daemonhost + -- dead-target tag release: vanilla keeps the tag until the corpse despawns (up to the + -- template lifetime), which starves mark_limit; drop the tag as soon as the target dies + if marked_tag and not marked_tag_is_manual then + local marked_target = marked_tag._target_unit + if marked_target and HEALTH_ALIVE and not HEALTH_ALIVE[marked_target] then + local smart_tag_system = context.smart_tag_system + local player_unit = context.player and context.player.player_unit + if smart_tag_system and player_unit then + mod:print_debug("Auto Mark target dead, releasing tag") + smart_tag_system:cancel_tag(marked_tag._id, player_unit, true) + marked_tag = nil + tag_context.cooldown = 0 + end + end + end if is_character_disabled and (tag_name == TAG_NAMES.COMPANION_TAG or tag_name == TAG_NAMES.SERVO_SKULL_TAG) then local disabling_unit = disabled_character_state_component and disabled_character_state_component.disabling_unit if disabling_unit and (not marked_tag or marked_tag._target_unit ~= disabling_unit) then