DopingControl v0.6.4

This commit is contained in:
2026-08-30 15:37:17 +02:00
parent ecab5ba845
commit 695dd9dcd4
23 changed files with 2278 additions and 296 deletions
+21 -7
View File
@@ -120,6 +120,15 @@ function E.NormalizeWeapon(isSelf, v, readable)
end
return false
end
-- Stock 1.12 GetWeaponEnchantInfo takes NO arguments: on a client without
-- SuperWoW the extra unit is ignored and the first return is the PLAYER's
-- hasMainHandEnchant (1|nil). Only the SuperWoW name channel answers about
-- the foreign unit, and it is always string-or-nil (measured: 11 names,
-- 14 nils, "" never). A non-string therefore says nothing about this unit
-- => not readable, never "has an imbue".
if v ~= nil and type(v) ~= "string" then
return nil
end
if v == nil then
if readable == true then
return false
@@ -998,10 +1007,12 @@ if CreateFrame then
end
E.SweepLastKnown(DC.lastKnown, rosterSet, E.CACHE_CAP)
local db = DopingControlDB
if db and db.testMode then
-- Test mode was switched ON while this scan was in flight: the
-- simulator fully replaces the data source ("real
-- data never beats the simulation") -- drop the result.
if DC.SimOwnsStore(db) then
-- Test mode OR demo mode was on (or switched on while this scan
-- was in flight): the simulator fully replaces the data source
-- ("real data never beats the simulation") -- drop the result.
-- This is the load-bearing gate: it is the only thing between a
-- finished scan and DC.store = E.NewStore(...) below.
results = {}
return
end
@@ -1055,8 +1066,11 @@ if CreateFrame then
-- Start(force) -> bool (scan started/restarted).
-- Already running: no-op unless force, which restarts with a fresh
-- roster snapshot. Test mode is NOT checked here -- an explicit Start
-- is user intent; only the READY_CHECK auto-trigger honors testMode.
-- roster snapshot. DC.SimOwnsStore is NOT checked here -- an explicit
-- Start is user intent, and the callers that are NOT user intent
-- (READY_CHECK, the roster-change and window-open auto-scans) check it
-- themselves. The scan may therefore run in test/demo mode; what it may
-- never do is publish, so finish() drops the result instead.
function E.Start(force)
if running then
if not force then
@@ -1087,7 +1101,7 @@ if CreateFrame then
eventFrame:SetScript("OnEvent", function()
if event == "READY_CHECK" then
local db = DopingControlDB
if db and db.readyCheckScan and not db.testMode then
if db and db.readyCheckScan and not DC.SimOwnsStore(db) then
E.Start()
end
return