From 3b395f7769a226d165d758c630d5bb62b0e448e2 Mon Sep 17 00:00:00 2001 From: Tercio Jose Date: Fri, 12 May 2023 12:49:23 -0300 Subject: [PATCH] Open Raid update --- Libs/LibOpenRaid/GetPlayerInformation.lua | 23 +++++++++++++++++++---- Libs/LibOpenRaid/LibOpenRaid.lua | 2 +- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/Libs/LibOpenRaid/GetPlayerInformation.lua b/Libs/LibOpenRaid/GetPlayerInformation.lua index 76811e70..d0fcce7e 100644 --- a/Libs/LibOpenRaid/GetPlayerInformation.lua +++ b/Libs/LibOpenRaid/GetPlayerInformation.lua @@ -504,9 +504,9 @@ local getSpellListAsHashTableFromSpellBook = function() local tabEnd = offset + numSpells for entryOffset = offset, tabEnd - 1 do local spellType, spellId = GetSpellBookItemInfo(entryOffset, "player") - local spellInfo = LIB_OPEN_RAID_COOLDOWNS_INFO[spellId] - if (spellInfo) then - local raceId = spellInfo.raceid + local spellData = LIB_OPEN_RAID_COOLDOWNS_INFO[spellId] + if (spellData) then + local raceId = spellData.raceid if (raceId) then if (type(raceId) == "table") then if (raceId[playerRaceId]) then @@ -612,7 +612,22 @@ local updateCooldownAvailableList = function() --build a list of all spells assigned as cooldowns for the player class for spellID, spellData in pairs(LIB_OPEN_RAID_COOLDOWNS_INFO) do --type 10 is an item cooldown and does not have a class or race id - if (spellData.class == playerClass or (spellData.raceid and spellData.raceid[playerRaceId]) or CONST_ISITEM_BY_TYPEID[spellData.type]) then --need to implement here to get the racial as racial cooldowns does not carry a class + + local passRaceId = false + local raceId = spellData.raceid + if (raceId) then + if (type(raceId) == "table") then + if (raceId[playerRaceId]) then + passRaceId = true + end + elseif (type(raceId) == "number") then + if (raceId == playerRaceId) then + passRaceId = true + end + end + end + + if (spellData.class == playerClass or passRaceId or CONST_ISITEM_BY_TYPEID[spellData.type]) then --need to implement here to get the racial as racial cooldowns does not carry a class --type 10 is an item cooldown and does not have a spellbook entry if (spellBookSpellList[spellID] or CONST_ISITEM_BY_TYPEID[spellData.type]) then LIB_OPEN_RAID_PLAYERCOOLDOWNS[spellID] = spellData diff --git a/Libs/LibOpenRaid/LibOpenRaid.lua b/Libs/LibOpenRaid/LibOpenRaid.lua index e75f55ff..1c2587d6 100644 --- a/Libs/LibOpenRaid/LibOpenRaid.lua +++ b/Libs/LibOpenRaid/LibOpenRaid.lua @@ -37,7 +37,7 @@ if (WOW_PROJECT_ID ~= WOW_PROJECT_MAINLINE and not isExpansion_Dragonflight()) t end local major = "LibOpenRaid-1.0" -local CONST_LIB_VERSION = 101 +local CONST_LIB_VERSION = 102 if (not LIB_OPEN_RAID_MAX_VERSION) then LIB_OPEN_RAID_MAX_VERSION = CONST_LIB_VERSION