Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
11 changes: 10 additions & 1 deletion Control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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")
Expand Down
12 changes: 12 additions & 0 deletions tests/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading