Skillet-Classic

Skillet-Classic

445k Downloads

Get Item Count

Brum8842 opened this issue ยท 2 comments

commented

Getting this error in the Skillet Menu
addon Version: 1.90 cata
game version: 4.4.0

3x Usage: local count = C_Item.GetItemCount(itemInfo [, includeBank, includeUses, includeReagentBank])
[string "=[C]"]: in function GetItemCount' [string "@Skillet-Classic/UI/MainFrame.lua"]:1278: in function UpdateTradeSkillWindow'
[string "@Skillet-Classic/UI/MainFrame.lua"]:477: in function updateFunction' [string "@Blizzard_SharedXML/SecureScrollTemplates.lua"]:257: in function FauxScrollFrame_OnVerticalScroll'
[string "*MainFrame.xml:1261_OnVerticalScroll"]:2: in function <[string "*MainFrame.xml:1261_OnVerticalScroll"]:1>
[string "=[C]"]: in function SetVerticalScroll' [string "@Blizzard_SharedXML/SecureScrollTemplates.lua"]:49: in function <Blizzard_SharedXML/SecureScrollTemplates.lua:48> [string "=[C]"]: in function SetValue'
[string "@Blizzard_SharedXML/SecureScrollTemplates.lua"]:191: in function FauxScrollFrame_Update' [string "@Skillet-Classic/UI/MainFrame.lua"]:1057: in function UpdateTradeSkillWindow'
[string "@Skillet-Classic/SkilletQueue.lua"]:51: in function AdjustInventory' [string "@Skillet-Classic/SkilletQueue.lua"]:692: in function ContinueCast'
[string "@Skillet-Classic/SkilletQueue.lua"]:589: in function ?' [string "@Ace3/CallbackHandler-1.0-8/CallbackHandler-1.0.lua"]:109: in function <...Ons/Ace3/CallbackHandler-1.0/CallbackHandler-1.0.lua:109> [string "=[C]"]: ? [string "@Ace3/CallbackHandler-1.0-8/CallbackHandler-1.0.lua"]:19: in function <...Ons/Ace3/CallbackHandler-1.0/CallbackHandler-1.0.lua:15> [string "@Ace3/CallbackHandler-1.0-8/CallbackHandler-1.0.lua"]:54: in function Fire'
[string "@Ace3/AceEvent-3.0-4/AceEvent-3.0.lua"]:120: in function <Ace3/AceEvent-3.0/AceEvent-3.0.lua:119>
[string "=[C]"]: in function CastSpellByName' [string "@Skillet-Classic/Skillet.lua"]:1449: in function ChangeTradeSkill'
[string "@Skillet-Classic/Skillet.lua"]:1510: in function SetTradeSkill' [string "@Skillet-Classic/UI/MainFrame.lua"]:745: in function TradeButton_OnClick'
[string "*MainFrame.xml:67_OnClick"]:2: in function <[string "*MainFrame.xml:67_OnClick"]:1>

Locals:
(*temporary) = "Usage: local count = C_Item.GetItemCount(itemInfo [, includeBank, includeUses, includeReagentBank])"

commented

You can fix this by changing line 1275 in MainFrame.lua as shown in the following patch. This will be fixed in the next build.

--- D:/WoWNew2/Skillet-Cata/UI/MainFrame.lua	Thu May  9 09:13:48 2024
+++ D:/World of Warcraft/_classic_/Interface/AddOns/Skillet-Classic/UI/MainFrame.lua	Sun May 12 05:40:51 2024
@@ -1275,7 +1275,7 @@
 -- show the count of the item currently owned that the recipe will produce
 --
 				if showOwned and self.currentPlayer == UnitName("player") then
-					local numowned = (self.db.realm.auctionData[self.currentPlayer][recipe.itemID] or 0) + GetItemCount(recipe.itemID,true)
+					local numowned = (self.db.realm.auctionData[self.currentPlayer][recipe.itemID] or 0) + GetItemCount(recipe.itemID or 0,true)
 					if numowned > 0 then
 						if numowned >= 1000 then
 							numowned = "##"
commented

OK, I modified that line and everything seems to be working as intended.