Fixed CTLD Hover assistant / Crate pickup not working.

This commit is contained in:
iTracerFacer 2025-11-12 20:19:40 -06:00
parent dddb2b3ce4
commit 0d9d348b6b
6 changed files with 31 additions and 6 deletions

View File

@ -2715,14 +2715,39 @@ function CTLD:_ensureAdaptiveBackgroundLoop()
CTLD._coachState[uname] = nil
end
end
-- If hover coach now empty, stop its scheduler
if next(CTLD._coachState) == nil then
end
-- Ensure the hover scan scheduler matches active transport presence
local hasTransports = false
for gname, _ in pairs(self.MenusByGroup or {}) do
local grp = nil
if GROUP and GROUP.FindByName then
local ok, res = pcall(function() return GROUP:FindByName(gname) end)
if ok then grp = res end
end
if grp and grp:IsAlive() then
hasTransports = true
break
end
if not grp and Group and Group.getByName then
local ok, dcsGrp = pcall(function() return Group.getByName(gname) end)
if ok and dcsGrp and dcsGrp:isExist() then
hasTransports = true
break
end
end
end
if hasTransports then
if (not self.HoverSched) and self._startHoverScheduler then
pcall(function() self:_startHoverScheduler() end)
end
else
if self.HoverSched and self.HoverSched.Stop then
pcall(function() self.HoverSched:Stop() end)
end
self.HoverSched = nil
end
end
-- Determine next wake interval based on active salvage crates
local baseInterval = (cfg and cfg.DetectionInterval) or 5

Binary file not shown.