mirror of
https://github.com/brues-code/SuperCleveRoidMacros.git
synced 2026-09-16 03:38:00 +00:00
Resolve [mhimbue:Name] via enchant DBC, not tooltip scan
CheckWeaponImbueByName now resolves the applied temp-enchant ID to its localized name via ClassicAPI (C_Item.GetEnchantInfo) and matches that directly -- exact and locale-clean, replacing the green-text tooltip heuristics for named enchants (poisons, oils, Mongoose, Windfury). Only nameless enchants (sharpening/weightstones, no DBC name) fall through to the tooltip scan, so no regression.
This commit is contained in:
@@ -4752,6 +4752,19 @@ function CleveRoids.CheckWeaponImbueByName(slot, imbueName)
|
||||
return true -- No name to check
|
||||
end
|
||||
|
||||
-- Fast path: resolve the applied temp-enchant's ID -> localized name via
|
||||
-- ClassicAPI (SpellItemEnchantment.dbc) and match that directly -- exact,
|
||||
-- locale-clean, no green-text tooltip heuristics. Only nameless enchants
|
||||
-- (e.g. sharpening stones, which show "+N Weapon Damage" and carry no DBC
|
||||
-- name) return nil here and fall through to the tooltip scan below.
|
||||
local _, _, _, enchantID = CleveRoids.ClassicAPI.GetWeaponEnchant(slot)
|
||||
local enchantName = enchantID and CleveRoids.ClassicAPI.GetEnchantName(enchantID)
|
||||
if enchantName then
|
||||
local nlower = GetLowerNormalizedName(enchantName)
|
||||
local want = GetLowerNormalizedName(imbueName)
|
||||
return nlower == want or string.find(nlower, want, 1, true) ~= nil
|
||||
end
|
||||
|
||||
-- Create tooltip scanner if needed
|
||||
if not CleveRoidsTooltip then
|
||||
CreateFrame("GameTooltip", "CleveRoidsTooltip", nil, "GameTooltipTemplate")
|
||||
|
||||
Reference in New Issue
Block a user