diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f0eddd..ff7e8d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ All notable changes to LifeTimeStats. Format: [Keep a Changelog](https://keepachangelog.com/), versions follow [SemVer](https://semver.org/). +## [Unreleased] + +### Fixed +- **Crowd control while it is restricted:** Forever 1.60.1 hides the whole loss-of-control entry at times (`SecretWhenLossOfControlRestricted`). Such an effect now counts once, under "Other loss of control" and without a duration, instead of being read field by field. + +### Checked +- Every client call added in 1.24 and 1.25 was checked against the Forever 1.60.1.70755 API declarations, including event payloads and secret-value rules: `LOSS_OF_CONTROL_ADDED`, `C_LossOfControl`, `CONFIRM_TALENT_WIPE`, `CINEMATIC_START`, `PLAY_MOVIE`, `STOP_MOVIE`, `PLAYER_SPECIALIZATION_CHANGED`, `C_Container.GetContainerItemInfo`, `C_Spell.GetSpellName`, `SetPortraitTexture` and the `Line` widget. + ## [1.25.0-forever] - 2026-11-16 Prerelease. Offline regression suites pass; not yet checked in the live client. The readability changes come from in-game screenshots of 1.24.0, and the two new skins from the user's mock-ups. diff --git a/Control.lua b/Control.lua index 78c3123..193a8b3 100644 --- a/Control.lua +++ b/Control.lua @@ -2,7 +2,8 @@ -- Copyright (C) 2026 Malikor. Licensed under GPL-3.0-or-later (see LICENSE). local _, ns = ... local Add, Max, On, Tally = ns.Add, ns.Max, ns.On, ns.Tally -local S, Bad = ns.IsSecret, ns.BadNumber +local Bad = ns.BadNumber +local function S(v) return ns.IsSecret(v) end -- looked up each time, so the check is always current local function Num(v) if type(v) == "number" and not S(v) and not Bad(v) then return v end end local function Str(v) if type(v) == "string" and not S(v) and v ~= "" then return v end end @@ -48,6 +49,9 @@ local function ReadControl(unit, index) if (not ok or type(data) ~= "table") and unit == "player" and type(api.GetActiveLossOfControlData) == "function" then ok, data = pcall(api.GetActiveLossOfControlData, index) end + -- While loss of control is restricted (Forever 1.60.1: SecretWhenLossOfControlRestricted) the + -- whole entry is secret: it still counts once, with no type, spell or time read from it. + if ok and data ~= nil and S(data) then return "secret" end if ok and type(data) == "table" then return data end end @@ -58,6 +62,11 @@ function ns.TrackLossOfControl(a, b) if unit ~= "player" or not Num(index) then return end local data = ReadControl(unit, index) if not data then return end + if data == "secret" then + Add("cc_taken"); Add("cc_other") + ns.src.lossOfControl = true + return + end local kind = CC_KIND[Str(data.locType) or ""] or "other" local name = SpellName(data.spellID) or Str(data.displayText) Add("cc_taken") diff --git a/tests/control.py b/tests/control.py index 8cc115c..7bf2c71 100644 --- a/tests/control.py +++ b/tests/control.py @@ -81,6 +81,18 @@ eq(c.cc_time, 26, "a hidden duration adds no time") ns.IsSecret = function() return false end +-- a wholly secret entry (loss of control restricted) counts once, as other, with no time +local realSecret = ns.IsSecret +local secretEntry = {} +locData[1] = secretEntry +ns.IsSecret = function(v) return v == secretEntry end +local before, beforeOther, beforeTime = c.cc_taken, c.cc_other, c.cc_time +fire("LOSS_OF_CONTROL_ADDED", "player", 1) +ns.IsSecret = realSecret +eq(c.cc_taken, before + 1, "a secret entry still counts") +eq(c.cc_other, beforeOther + 1, "as other") +eq(c.cc_time, beforeTime, "and adds no time") + -- ------------------------------------------------------------ cinematics fire("CINEMATIC_START") NOW = NOW + 42