From 403567b381a44c2fdec29a9bd5616836bb9e73c8 Mon Sep 17 00:00:00 2001 From: Brues <5278969+brues-code@users.noreply.github.com> Date: Tue, 28 Jul 2026 00:00:51 -0500 Subject: [PATCH] Scan nameplateN unit tokens for /target candidates, not SuperWoW WorldFrame The /target candidate search's last SuperWoW-gated block walked WorldFrame children and scraped GUIDs via pcall(frame.GetName, frame, 1). ClassicAPI now provides modern nameplateN unit tokens that work with UnitExists/UnitCanAttack/ TargetUnit directly, so it collapses to iterating nameplate1..40 -- no SuperWoW dependency, no WorldFrame hackery, and it also picks up default vanilla nameplates. Scans the full range since assigned slots can be sparse. --- Core.lua | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/Core.lua b/Core.lua index 260ef06..f4d65b6 100644 --- a/Core.lua +++ b/Core.lua @@ -2845,20 +2845,16 @@ function CleveRoids.DoTarget(msg) addCandidate(focusTok .. "target") end - if CleveRoids.hasSuperwow then - local numChildren = WorldFrame:GetNumChildren() - local children = { WorldFrame:GetChildren() } - - for i = 1, numChildren do - local frame = children[i] - if frame and frame:IsVisible() then - local success, guid = pcall(frame.GetName, frame, 1) - if success and guid and type(guid) == "string" and string.len(guid) > 0 then - if UnitExists(guid) then - addCandidate(guid) - end - end - end + -- Visible nameplates as targeting candidates, via ClassicAPI's nameplateN + -- unit tokens -- no SuperWoW WorldFrame child-walk / GUID scrape, and covers + -- default vanilla nameplates too. Slots are sparse (a removed plate leaves + -- its slot vacant until reused), so scan the full range rather than breaking + -- on the first gap; UnitExists returns false cleanly for a free/out-of-range + -- slot. + for i = 1, 40 do + local plate = "nameplate" .. i + if UnitExists(plate) then + addCandidate(plate) end end