Skip to content

Commit

Permalink
Updating LibOpenRaid in an attempt to fix a bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tercioo committed Sep 27, 2022
1 parent bc481be commit e10d009
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 13 deletions.
16 changes: 10 additions & 6 deletions Libs/LibOpenRaid/LibOpenRaid.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,21 @@ BUGS:
--]=]

local IsDragonflight = function()
return select(4, GetBuildInfo()) >= 100000
local versionString, revision, launchDate, gameVersion = GetBuildInfo()

local isExpansion_Dragonflight = function()
if (gameVersion >= 100000) then
return true
end
end

--don't load if it's not retail, emergencial patch due to classic and bcc stuff not transposed yet
if (WOW_PROJECT_ID ~= WOW_PROJECT_MAINLINE and not IsDragonflight()) then
if (WOW_PROJECT_ID ~= WOW_PROJECT_MAINLINE and not isExpansion_Dragonflight()) then
return
end

local major = "LibOpenRaid-1.0"
local CONST_LIB_VERSION = 53
local CONST_LIB_VERSION = 54
LIB_OPEN_RAID_CAN_LOAD = false

--declae the library within the LibStub
Expand All @@ -65,7 +69,7 @@ LIB_OPEN_RAID_CAN_LOAD = false
end

LIB_OPEN_RAID_CAN_LOAD = true

--default values
openRaidLib.inGroup = false
openRaidLib.UnitIDCache = {}
Expand Down Expand Up @@ -148,7 +152,7 @@ LIB_OPEN_RAID_CAN_LOAD = false
for i = 1, select("#", ...) do
local clientVersion = select(i, ...)

if (clientVersion == "retail" and (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE or IsDragonflight())) then --retail
if (clientVersion == "retail" and (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE or isExpansion_Dragonflight())) then --retail
return true

elseif (clientVersion == "classic_era" and WOW_PROJECT_ID == WOW_PROJECT_CLASSIC) then --classic era (vanila)
Expand Down
52 changes: 47 additions & 5 deletions Libs/LibOpenRaid/ThingsToMantain.lua
Original file line number Diff line number Diff line change
@@ -1,11 +1,42 @@

--data which main need maintenance over time

--alert the user that something went wrong
C_Timer.After(10, function()
if (not LIB_OPEN_RAID_DATABASE_LOADED) then
print("Details! > LibOpenRaid failed to load, check BugSack for errors and report.")
end
end)

if (not LIB_OPEN_RAID_CAN_LOAD) then
return
end

local expansionId = GetServerExpansionLevel()
local versionString, revision, launchDate, gameVersion = GetBuildInfo()

local isExpansion_Dragonflight = function()
if (gameVersion >= 100000) then
return true
end
end

local isExpansion_Shadowlands = function()
if (gameVersion < 100000 and gameVersion >= 90000) then
return true
end
end

local isExpansion_LichKing = function()
if (gameVersion < 40000 and gameVersion >= 30000) then
return true
end
end

local isExpansion_Vanilla = function()
if (gameVersion < 20000) then
return true
end
end

--localization
local gameLanguage = GetLocale()
Expand Down Expand Up @@ -80,7 +111,10 @@ elseif (gameLanguage == "zhTW") then
L["STRING_CRITICAL_ONLY"] = "致命"
end

if (expansionId == LE_EXPANSION_WRATH_OF_THE_LICH_KING) then
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--Wrath of the Lich King

if (isExpansion_LichKing()) then
LIB_OPEN_RAID_BLOODLUST = {
[2825] = true, --bloodlust
[32182] = true, --heroism
Expand All @@ -104,7 +138,7 @@ if (expansionId == LE_EXPANSION_WRATH_OF_THE_LICH_KING) then
[INVSLOT_HAND] = 3, --strenth only
}

LIB_OPEN_RAID_MYTHICKEYSTONE_ITEMID = 0
LIB_OPEN_RAID_MYTHICKEYSTONE_ITEMID = 180653
LIB_OPEN_RAID_AUGMENTATED_RUNE = 0

LIB_OPEN_RAID_COVENANT_ICONS = {}
Expand All @@ -115,7 +149,10 @@ if (expansionId == LE_EXPANSION_WRATH_OF_THE_LICH_KING) then

LIB_OPEN_RAID_WEAPON_ENCHANT_IDS = {}

elseif (expansionId == LE_EXPANSION_SHADOWLANDS) then
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--Shadowlands

elseif (isExpansion_Shadowlands()) then
LIB_OPEN_RAID_BLOODLUST = {
[2825] = true, --bloodlust
[32182] = true, --heroism
Expand Down Expand Up @@ -230,7 +267,10 @@ elseif (expansionId == LE_EXPANSION_SHADOWLANDS) then
[5401] = true, --windfury
}

elseif (expansionId == LE_EXPANSION_LEVEL_CURRENT) then --latest retail version after LE_EXPANSION_SHADOWLANDS
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--Dragonflight

elseif (isExpansion_Dragonflight()) then
LIB_OPEN_RAID_BLOODLUST = {
[2825] = true, --bloodlust
[32182] = true, --heroism
Expand Down Expand Up @@ -788,3 +828,5 @@ LIB_OPEN_RAID_SPELL_DEFAULT_IDS = {
--191427 havoc
}
--need to add mass dispell (32375)

LIB_OPEN_RAID_DATABASE_LOADED = true
4 changes: 2 additions & 2 deletions boot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

local version, build, date, tocversion = GetBuildInfo()

_detalhes.build_counter = 10030
_detalhes.alpha_build_counter = 10030 --if this is higher than the regular counter, use it instead
_detalhes.build_counter = 10031
_detalhes.alpha_build_counter = 10031 --if this is higher than the regular counter, use it instead
_detalhes.dont_open_news = true
_detalhes.game_version = version
_detalhes.userversion = version .. _detalhes.build_counter
Expand Down

0 comments on commit e10d009

Please sign in to comment.