From 1827c9e3c0c67cf79f04a4551a330704dbda73c0 Mon Sep 17 00:00:00 2001 From: michael Date: Sat, 3 Oct 2026 16:23:22 -0400 Subject: [PATCH] =?UTF-8?q?fix+feat:=20auto-hack=20LOS=20bypass=20now=20fl?= =?UTF-8?q?ips=20GameParameters.testify=20around=20a=20normal=20orig=20set?= =?UTF-8?q?=5Ftag=20call=20(keeps=20upstream=20bookkeeping/template/rpc=20?= =?UTF-8?q?intact=20=E2=80=94=20previous=20accept-branch=20replication=20d?= =?UTF-8?q?iverged=20and=20caused=20inconsistency);=20auto-marking=20verif?= =?UTF-8?q?ied=20to=20never=20hit=20the=20look-gate=20(set=5Fauto=5Fmark?= =?UTF-8?q?=20creates=20tags=20directly),=20so=20sniper=20misses=20were=20?= =?UTF-8?q?the=20100m=20max=5Frange=20cap=20=E2=80=94=20slider=20ceiling?= =?UTF-8?q?=20raised=20to=20250?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scripts/mods/AutoMark/AutoMark_data.lua | 2 +- .../scripts/mods/AutoMark/mark/base_mark.lua | 3 ++ .../mods/AutoMark/mark/servo_skull_mark.lua | 44 +++++++++++-------- 3 files changed, 29 insertions(+), 20 deletions(-) diff --git a/AutoMark/scripts/mods/AutoMark/AutoMark_data.lua b/AutoMark/scripts/mods/AutoMark/AutoMark_data.lua index 4dc9524..9ddec6c 100644 --- a/AutoMark/scripts/mods/AutoMark/AutoMark_data.lua +++ b/AutoMark/scripts/mods/AutoMark/AutoMark_data.lua @@ -784,7 +784,7 @@ local widgets = { setting_id = "max_range", type = "numeric", default_value = 100, - range = { 1, 100 }, + range = { 1, 250 }, unit_text = "meter", decimals_number = 0 }, diff --git a/AutoMark/scripts/mods/AutoMark/mark/base_mark.lua b/AutoMark/scripts/mods/AutoMark/mark/base_mark.lua index 256a906..70028c2 100644 --- a/AutoMark/scripts/mods/AutoMark/mark/base_mark.lua +++ b/AutoMark/scripts/mods/AutoMark/mark/base_mark.lua @@ -124,6 +124,9 @@ function mod:set_manual_mark(tag_name, target_unit, target_tag) end end + if mod.ensure_automark_tag_hook then + mod:ensure_automark_tag_hook() + end smart_tag_system:set_tag(tag_name, player_unit, target_unit) end diff --git a/AutoMark/scripts/mods/AutoMark/mark/servo_skull_mark.lua b/AutoMark/scripts/mods/AutoMark/mark/servo_skull_mark.lua index 2311a55..9321672 100644 --- a/AutoMark/scripts/mods/AutoMark/mark/servo_skull_mark.lua +++ b/AutoMark/scripts/mods/AutoMark/mark/servo_skull_mark.lua @@ -43,39 +43,44 @@ local function ensure_automark_tag_hook() if type(orig_set_tag) ~= "function" then return end + -- GameParameters.testify short-circuits _tagger_is_looking_at_target (the dot-0.75 aim + -- cone + LOS sweep the game runs on host-side set_tag). Flipping it for the duration of + -- our own synchronous set_tag call keeps the ENTIRE vanilla chain alive (upstream's own + -- set_tag bookkeeping hook, group limits, template start(), rpc, telemetry) — earlier + -- attempts that replicated the accept-branch diverged from that bookkeeping, which is + -- why marking behaved so inconsistently. Auto-marking (set_auto_mark) creates tags + -- directly and never passes through here; this covers the servo-skull HACK orders only. + -- All other testify consumers are load-time UI requires / menu draw code that never + -- runs inside this window. local patched = {} patched.set_tag = function(self, template_name, tagger_unit, target_unit, target_location) - if self ~= smart_tag_system then - return orig_set_tag(self, template_name, tagger_unit, target_unit, target_location) - end - mod.omni_hack_hook_count = (mod.omni_hack_hook_count or 0) + 1 - if template_name == HACK_TAG_NAME and target_unit and self._is_server and not patched.in_branch then + 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 if mod_settings.debug_mode and not mod.omni_hack_hook_fired then mod.omni_hack_hook_fired = true - mod:diag("OMNI-HACK-DIAG hook FIRE is_server=", tostring(self._is_server)) + mod:diag("OMNI-HACK-DIAG hook FIRE (testify-bypass) template=", tostring(template_name)) end + mod.omni_hack_hook_count = (mod.omni_hack_hook_count or 0) + 1 + local saved_testify = GameParameters.testify patched.in_branch = true - local ok, err = pcall(function() - local tag_id = self:_generate_tag_id() - local tag = self:_create_tag_locally(tag_id, template_name, tagger_unit, target_unit, target_location) - self:_server_check_tag_group_limit(tagger_unit, tag:group()) - local template_name_id = NetworkLookup.smart_tag_templates[template_name] - local tagger_game_object_id = Managers.state.unit_spawner:game_object_id(tagger_unit) - local target_game_object_id = Managers.state.unit_spawner:game_object_id(target_unit) - Managers.state.game_session:send_rpc_clients("rpc_set_smart_tag", tag_id, template_name_id, tagger_game_object_id, target_game_object_id, nil, target_location) + local ok = pcall(function() + GameParameters.testify = true + orig_set_tag(self, template_name, tagger_unit, target_unit, target_location) end) + GameParameters.testify = saved_testify patched.in_branch = nil - if ok then + if not ok then + if mod_settings.debug_mode and not mod.omni_hack_taghook_err_logged then + mod.omni_hack_taghook_err_logged = true + mod:diag("OMNI-HACK-DIAG testify-bypass orig set_tag threw:", "see console") + end + else return end - if mod_settings.debug_mode and not mod.omni_hack_taghook_err_logged then - mod.omni_hack_taghook_err_logged = true - mod:diag("OMNI-HACK-DIAG tag-branch replication FAILED:", tostring(err)) - end end end + mod.omni_hack_hook_count = (mod.omni_hack_hook_count or 0) + 1 return orig_set_tag(self, template_name, tagger_unit, target_unit, target_location) end rawset(smart_tag_system, "set_tag", patched.set_tag) @@ -85,6 +90,7 @@ local function ensure_automark_tag_hook() mod:diag("OMNI-HACK-DIAG set_tag instance-shadow INSTALLED marker=", tostring(rawget(smart_tag_system, "set_tag") == patched.set_tag)) end end +mod.ensure_automark_tag_hook = ensure_automark_tag_hook local function servo_skull_mark_callback() local smart_tag_system = context.smart_tag_system