Skip to content

Commit

Permalink
Reverted to old check
Browse files Browse the repository at this point in the history
new check if acting weird
  • Loading branch information
SecretX33 committed Dec 3, 2020
1 parent f66cdaa commit 1958074
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion AutomaticWeaponRemoval.lua
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,20 @@ function AWR:PLAYER_DIFFICULTY_CHANGED()
if self.db.enabled then checkIfAddonShouldBeEnabled() end
end

local function isLadyDead()
local instanceName = GetInstanceInfo()
if instanceName~="Icecrown Citadel" then return true end -- If we are not inside ICC, this function will return false so the addon will disable itself

-- [API_GetInstanceLockTimeRemaining] returns info about current instance, index 4 is encountersComplete, or how many bosses are already dead
local bossesKilled = select(4, GetInstanceLockTimeRemaining())

if bossesKilled~=nil then
if wrDebug then send("for this instance, bossesKilled value is " .. bossesKilled) end
if bossesKilled > 2 then return true end
end
return false
end

local function isLadyNextEncounter()
local instanceName = GetInstanceInfo()
if instanceName~="Icecrown Citadel" then return false end -- If we are not inside ICC, this function will return false so the addon will disable itself
Expand All @@ -272,7 +286,7 @@ local function checkIfAddonShouldBeEnabled()
--if wrDebug then send("GetInstanceInfo inside checkIfAddonShouldBeEnabled returned " .. GetInstanceInfo()) end

-- Check if user disabled the addon, if the player is inside ICC, if the ICC is either 25n, 10hc or 25hc and if it's 10 man mode then if it's heroic or not
if AWR.db.enabled and ((instanceName == "Icecrown Citadel" and (difficultyIndex > 1 or isHeroic) and isLadyNextEncounter()) or wrDebug) then
if AWR.db.enabled and ((instanceName == "Icecrown Citadel" and (difficultyIndex > 1 or isHeroic) and not isLadyDead()) or wrDebug) then
regForAllEvents()
else
unregFromAllEvents()
Expand Down

0 comments on commit 1958074

Please sign in to comment.