From 6f78be8394dcf67885c2172cd018710512298bed Mon Sep 17 00:00:00 2001 From: Brues <5278969+brues-code@users.noreply.github.com> Date: Wed, 9 Sep 2026 12:49:46 -0500 Subject: [PATCH] Detect the relic slot via UnitHasRelicSlot instead of hardcoded classes IsRelicSlot no longer tests playerClass against PALADIN/DRUID/SHAMAN. It now reads CleveRoids.hasRelicSlot, sampled once in PLAYER_LOGIN. Also folds PerformEquipSwap's slot-18 check into the same helper. Its class list (HUNTER/WARRIOR/ROGUE/MAGE/WARLOCK/PRIEST) was the exact complement of the relic classes, so it becomes `not IsRelicSlot(inventoryId)` and the two lists can no longer drift apart. --- Core.lua | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/Core.lua b/Core.lua index b4fb8e4..95710ed 100644 --- a/Core.lua +++ b/Core.lua @@ -261,11 +261,11 @@ local function GetInventoryIdFromSlot(slotName) return SLOT_TO_INVID[slotName] or GetInventorySlotInfo(slotName) end --- Check if slot 18 is a relic (no GCD) for current player class +-- Check if slot 18 is a relic (no GCD). Backed by CleveRoids.hasRelicSlot, cached +-- at PLAYER_LOGIN -- see the note there on why it can't be sampled on demand. local function IsRelicSlot(slot) if slot ~= 18 then return false end - local playerClass = CleveRoids.playerClass - return playerClass == "PALADIN" or playerClass == "DRUID" or playerClass == "SHAMAN" + return CleveRoids.hasRelicSlot or false end -- PERFORMANCE: Cache GetTime() result for cooldown checks within same frame @@ -289,16 +289,11 @@ local function PerformEquipSwap(item, inventoryId, useQueueScript) if not item or not inventoryId then return false end -- Check if in combat and swapping weapons - -- Slot 18 (ranged) is only a weapon for Hunter/Warrior/Rogue/Mage/Warlock/Priest - -- For Druid/Paladin/Shaman, slot 18 is idol/libram/totem - can swap freely + -- Slot 18 is a ranged weapon for exactly the classes with no relic slot; for + -- Paladin/Druid/Shaman it's an idol/libram/totem that can swap freely. local isWeapon = (inventoryId == 16 or inventoryId == 17) if inventoryId == 18 then - -- Use cached playerClass for performance - local playerClass = CleveRoids.playerClass - -- Only treat slot 18 as weapon for classes that use ranged weapons - isWeapon = (playerClass == "HUNTER" or playerClass == "WARRIOR" or - playerClass == "ROGUE" or playerClass == "MAGE" or - playerClass == "WARLOCK" or playerClass == "PRIEST") + isWeapon = not IsRelicSlot(inventoryId) end if isWeapon and UnitAffectingCombat("player") then @@ -4984,6 +4979,9 @@ function CleveRoids.Frame:PLAYER_LOGIN() if CleveRoids.disabled then return end _, CleveRoids.playerClass = UnitClass("player") + + CleveRoids.hasRelicSlot = UnitHasRelicSlot("player") and true or false + CleveRoids.IndexSpells() CleveRoids.IndexPetSpells() CleveRoids.initializationTimer = GetTime() + 1.5