Skip to content

Commit

Permalink
Potential fix for issue #96
Browse files Browse the repository at this point in the history
  • Loading branch information
b-morgan committed Sep 19, 2022
1 parent 6e6b988 commit 60557b6
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 21 deletions.
28 changes: 8 additions & 20 deletions Skillet.lua
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,7 @@ function Skillet:OnEnable()
self:RegisterEvent("TRADE_REQUEST_CANCEL")
self:RegisterEvent("TRADE_UPDATE");
self:RegisterEvent("TRADE_ACCEPT_UPDATE")

--
-- Debugging cleanup if enabled
--
Expand Down Expand Up @@ -844,7 +845,7 @@ function Skillet:PLAYER_ENTERING_WORLD()
end

function Skillet:ADDON_ACTION_BLOCKED()
DA.TRACE("ADDON_ACTION_BLOCKED")
DA.TRACE("ADDON_ACTION_BLOCKED()")
-- print("|cf0f00000Skillet-Classic|r: Combat lockdown restriction." ..
-- " Leave combat and try again.")
-- self:HideAllWindows()
Expand Down Expand Up @@ -1286,20 +1287,20 @@ function Skillet:TRADE_MONEY_CHANGED()
DA.TRACE("TRADE_MONEY_CHANGED()")
end

function Skillet:TRADE_TARGET_ITEM_CHANGED()
DA.TRACE("TRADE_TARGET_ITEM_CHANGED()")
function Skillet:TRADE_PLAYER_ITEM_CHANGED(event, tradeSlotIndex)
DA.TRACE("TRADE_PLAYER_ITEM_CHANGED( "..tostring(tradeSlotIndex).." )")
end

function Skillet:TRADE_PLAYER_ITEM_CHANGED()
DA.TRACE("TRADE_PLAYER_ITEM_CHANGED()")
function Skillet:TRADE_TARGET_ITEM_CHANGED(event, tradeSlotIndex)
DA.TRACE("TRADE_TARGET_ITEM_CHANGED( "..tostring(tradeSlotIndex).." )")
end

function Skillet:TRADE_REPLACE_ENCHANT()
DA.TRACE("TRADE_REPLACE_ENCHANT()")
end

function Skillet:TRADE_POTENTIAL_BIND_ENCHANT()
DA.TRACE("TRADE_POTENTIAL_BIND_ENCHANT()")
function Skillet:TRADE_POTENTIAL_BIND_ENCHANT(event, canBecomeBoundForTrade)
DA.TRACE("TRADE_POTENTIAL_BIND_ENCHANT( "..tostring(canBecomeBoundForTrade).." )")
end

function Skillet:TRADE_REQUEST()
Expand All @@ -1318,19 +1319,6 @@ function Skillet:TRADE_ACCEPT_UPDATE()
DA.TRACE("TRADE_ACCEPT_UPDATE()")
end

function Skillet:TRADE_ACCEPT_UPDATE()
DA.TRACE("TRADE_ACCEPT_UPDATE()")
end

--
-- Trade window close, the counts may need to be updated.
-- This could be because an enchant has used up mats or the player
-- may have received more mats.
--
function Skillet:TRADE_CLOSED()
self:BAG_UPDATE("FAKE_BAG_UPDATE", 0)
end

local function indexBags()
DA.TRACE("indexBags()")
local player = Skillet.currentPlayer
Expand Down
18 changes: 17 additions & 1 deletion SkilletQueue.lua
Original file line number Diff line number Diff line change
Expand Up @@ -568,14 +568,30 @@ function Skillet:UNIT_SPELLCAST_FAILED_QUIET(event, unit, castGUID, spellID)
self.castSpellName = GetSpellInfo(spellID)
DA.TRACE("tradeID= "..tostring(self.currentTrade)..", spellName= "..tostring(self.castSpellName)..", processingSpell= "..tostring(self.processingSpell))
if unit == "player" and self.processingSpell and self.processingSpell == self.castSpellName then
if TradeFrame:IsShown() then
if self.currentTrade == 7411 and TradeFrame:IsShown() then
DA.TRACE("TradeFrame:IsShown()")
self.tradeEnchant = true
else
Skillet:StopCast(self.castSpellName,false)
end
end
end

--
-- Trade window close, the counts may need to be updated.
-- This could be because an enchant has used up mats or the player
-- may have received more mats.
--
function Skillet:TRADE_CLOSED()
DA.TRACE("TRADE_CLOSED()")
if self.currentTrade == 7411 and self.tradeEnchant then
self.tradeEnchant = false
Skillet:StopCast(self.castSpellName,true)
end
self:BAG_UPDATE("FAKE_BAG_UPDATE", 0)
end


function Skillet:UNIT_SPELLCAST_INTERRUPTED(event, unit, castGUID, spellID)
DA.TRACE("UNIT_SPELLCAST_INTERRUPTED("..tostring(unit)..", "..tostring(castGUID)..", "..tostring(spellID)..")")
self.castSpellID = spellID
Expand Down

0 comments on commit 60557b6

Please sign in to comment.