From a0f16a3794f4bd2ea1c06fb986d3e661639906e3 Mon Sep 17 00:00:00 2001 From: Adrian L Lange Date: Mon, 15 Sep 2014 02:58:13 +0200 Subject: [PATCH] Make sure the player has any of the currency --- BonusRollPreview.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/BonusRollPreview.lua b/BonusRollPreview.lua index 04aae7c..67accc4 100644 --- a/BonusRollPreview.lua +++ b/BonusRollPreview.lua @@ -330,15 +330,17 @@ function Container:PLAYER_LOOT_SPEC_UPDATED(event) HandlePosition() end -function Container:SPELL_CONFIRMATION_PROMPT(event, spellID, confirmType) +function Container:SPELL_CONFIRMATION_PROMPT(event, spellID, confirmType, _, _, currencyID) if(confirmType == CONFIRMATION_PROMPT_BONUS_ROLL) then currentEncounterID = ns.encounterIDs[spellID] if(currentEncounterID) then - self:RegisterEvent('EJ_LOOT_DATA_RECIEVED') - self:RegisterEvent('PLAYER_LOOT_SPEC_UPDATED') - - self:Update() + local _, count = GetCurrencyInfo(currencyID) + if(count > 0) then + self:RegisterEvent('EJ_LOOT_DATA_RECIEVED') + self:RegisterEvent('PLAYER_LOOT_SPEC_UPDATED') + self:Update() + end else print('|cffff8080BonusRollPreview:|r Found an unknown spell [' .. spellID .. ']. Please report this!') end -- 1.7.9.5