fix+feat: auto-hack LOS bypass now flips GameParameters.testify around a normal orig set_tag call (keeps upstream bookkeeping/template/rpc intact — previous accept-branch replication diverged and caused inconsistency); auto-marking verified to never hit the look-gate (set_auto_mark creates tags directly), so sniper misses were the 100m max_range cap — slider ceiling raised to 250

This commit is contained in:
2026-10-03 16:23:22 -04:00
parent 19046de0e7
commit 1827c9e3c0
3 changed files with 29 additions and 20 deletions
@@ -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
},
@@ -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
@@ -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
return
end
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 tag-branch replication FAILED:", tostring(err))
mod:diag("OMNI-HACK-DIAG testify-bypass orig set_tag threw:", "see console")
end
else
return
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