diff --git a/TranqRotate.toc b/TranqRotate.toc index ade9dd3..1baaf83 100644 --- a/TranqRotate.toc +++ b/TranqRotate.toc @@ -1,8 +1,8 @@ -## Interface: 11305 -## Title: TranqRotate |cff00aa001.5.0|r +## Interface: 11307 +## Title: TranqRotate |cff00aa001.5.1|r ## Notes: A tranqshot rotation assistant ## Author: Slivo -## Version: 1.5.0 +## Version: 1.5.1 ## SavedVariables: TranqRotateDb ## OptionalDeps: Ace3 diff --git a/changelog.md b/changelog.md index 2b77202..2d594cd 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,11 @@ ## TranqRotate Changelog +#### v1.5.1 + +- Handles the new dispel resistance mechanic +- Fix a bad nil check in comms +- Fix a logic issue in hunter list cleaning function + #### v1.5.0 - Restricted ordering tranq rotation to raid leader, raid assists and hunters diff --git a/src/comms.lua b/src/comms.lua index 45e8218..07d4064 100644 --- a/src/comms.lua +++ b/src/comms.lua @@ -127,10 +127,15 @@ end function TranqRotate:receiveSyncTranq(prefix, message, channel, sender) local hunter = TranqRotate:getHunter(message.player) + + if (hunter == nil) then + return + end + local notDuplicate = hunter.lastTranqTime < GetTime() - TranqRotate.constants.duplicateTranqshotDelayThreshold - if (hunter ~= nil and notDuplicate) then - TranqRotate:rotate(TranqRotate:getHunter(message.player), message.fail) + if (notDuplicate) then + TranqRotate:rotate(hunter, message.fail) end end diff --git a/src/events.lua b/src/events.lua index abc6594..d167e7d 100644 --- a/src/events.lua +++ b/src/events.lua @@ -47,7 +47,7 @@ function TranqRotate:COMBAT_LOG_EVENT_UNFILTERED() if (sourceGUID == UnitGUID("player")) then TranqRotate:sendAnnounceMessage(TranqRotate.db.profile.announceSuccessMessage, destName) end - elseif (event == "SPELL_MISSED") then + elseif (event == "SPELL_MISSED" or event == "SPELL_DISPEL_FAILED") then TranqRotate:sendSyncTranq(hunter, true, timestamp) TranqRotate:rotate(hunter, true) if (sourceGUID == UnitGUID("player")) then diff --git a/src/rotation.lua b/src/rotation.lua index f4a01f8..043e912 100644 --- a/src/rotation.lua +++ b/src/rotation.lua @@ -250,12 +250,19 @@ end -- Iterate over hunter list and purge hunter that aren't in the group anymore function TranqRotate:purgeHunterList() + + local hunterToRemove = {} + for _, hunter in pairs(TranqRotate.hunterTable) do if (not UnitInParty(hunter.name)) then - TranqRotate:unregisterUnitEvents(hunter) - TranqRotate:removeHunter(hunter) + table.insert(hunterToRemove, hunter) end end + + for _, hunter in pairs(hunterToRemove) do + TranqRotate:unregisterUnitEvents(hunter) + TranqRotate:removeHunter(hunter) + end end -- Iterate over all raid members to find hunters and update their status