From 718a758b875a184280f4dae5000d4764ff2896fe Mon Sep 17 00:00:00 2001 From: Adrian L Lange Date: Thu, 8 Jan 2015 00:16:53 +0100 Subject: [PATCH] Make sure we let the items arrive properly, and not disturb the Encounter Journal --- BonusRollPreview.lua | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/BonusRollPreview.lua b/BonusRollPreview.lua index 483b1f3..04e3e23 100644 --- a/BonusRollPreview.lua +++ b/BonusRollPreview.lua @@ -236,6 +236,11 @@ function Container:Populate() local numItems = 0 for index = 1, EJ_GetNumLoot() do local name, texture, slot, itemClass, itemID, itemLink, encounterID = EJ_GetLootInfoByIndex(index) + if(not itemLink) then + -- Let the client receive the data + return + end + if(encounterID == currentEncounterID and not ns.itemBlacklist[itemID]) then numItems = numItems + 1 @@ -278,11 +283,13 @@ function Container:Populate() if(EncounterJournal) then EncounterJournal:RegisterEvent('EJ_LOOT_DATA_RECIEVED') EncounterJournal:RegisterEvent('EJ_DIFFICULTY_UPDATE') + self:UnregisterEvent('EJ_LOOT_DATA_RECIEVED') end end function Container:Update() if(EncounterJournal) then + EncounterJournal:UnregisterEvent('EJ_LOOT_DATA_RECIEVED') EncounterJournal:UnregisterEvent('EJ_DIFFICULTY_UPDATE') end @@ -314,11 +321,9 @@ function Container:Update() end function Container:EJ_LOOT_DATA_RECIEVED(event) - if(EncounterJournal) then - EncounterJournal:UnregisterEvent(event) + if(BonusRollFrame:IsShown()) then + self:Populate() end - - self:Populate() end function Container:PLAYER_LOOT_SPEC_UPDATED(event) @@ -346,7 +351,6 @@ end function Container:SPELL_CONFIRMATION_TIMEOUT() currentEncounterID = nil - self:UnregisterEvent('EJ_LOOT_DATA_RECIEVED') self:UnregisterEvent('PLAYER_LOOT_SPEC_UPDATED') end -- 1.7.9.5