Skip to content

Commit a91ef8a

Browse files
Krathe82mergetest
authored andcommitted
Click Casting: skip secret values when scanning Blizzard frames for status bars
FindHealthManaBars recursively walks a Blizzard frame's whole table graph looking for HealthBar/ManaBar keys, using each visited table as a key in a 'checked' dedupe set. Under 12.x secret values, a protected frame/unit reference stored on the frame passes the type()=='table' check but throws 'attempted to index a table that cannot be indexed with secret keys' the moment it's used as that key. The throw propagated up through registerBlizzardFrame and aborted the RegisterBlizzardFrames loop on OnCombatEnd, so frames after the failing one never got RegisterFrame() - click-casting silently stopped working on Blizzard frames until reload (matches user reports of binds not working / 'frame doesn't accept my bind'). Guard traverse() with issecretvalue() before the table is used as a key. Health/mana bars are plain child frames, so skipping secret subtrees loses nothing. PropagateMouseOnChildren (the sibling walker) uses GetChildren() + IsForbidden and was already safe; the registration validator already bails on secret protected/name values.
1 parent 75b6c30 commit a91ef8a

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
* (Interface) Opening a colour picker no longer counts as a colour change — the picker fired its change handlers once during setup, which could commit settings (such as a Text Designer element's colour override) without any edit. (by Krathe)
99
* (Aura Designer) Fixed expiring border animations staying stuck on after the tracked aura was refreshed (for example re-casting a HoT in its pandemic window). (by Krathe)
1010

11+
### Bug Fixes
12+
13+
* (Click Casting) Fixed a Lua error walking Blizzard unit frames after combat that could stop click-casting bindings from working on the default frames until reload — the frame scan now skips protected (secret) values introduced by recent client versions. (by Krathe)
14+
1115
## [4.7.0]
1216

1317
### Bug Fixes

ClickCasting/Frames.lua

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -924,8 +924,16 @@ function CC:FindHealthManaBars(obj)
924924

925925
local function traverse(current)
926926
if type(current) ~= "table" then return end
927+
-- 12.x secret values: a protected frame/unit reference stored on a
928+
-- Blizzard frame passes the type()=="table" check but throws the moment
929+
-- it's used as a table key ("cannot be indexed with secret keys"). That
930+
-- aborted RegisterBlizzardFrames on combat end, so Blizzard frames never
931+
-- finished click-cast setup and bindings stopped working on them. We
932+
-- never need to descend into secret subtrees (health/mana bars are plain
933+
-- child frames), so skip them before `current` is used as a key below.
934+
if issecretvalue(current) then return end
927935
if checked[current] then return end
928-
936+
929937
checked[current] = true
930938
if not pcall(next, current) then return end
931939
for key, value in pairs(current) do

0 commit comments

Comments
 (0)