count = GetItemCount(itemID or "itemName" or "itemLink"[, includeBank][, includeCharges])
includeBank
Boolean - true: count includes bank items
In _retail_, GetItemCount("itemName") gives number in inventory, GetItemCount("itemName",true) gives number in both, and GetItemCount("itemName",false) gives number in inventory.
In _classic_ it should work the same way, correct?
In _classic_ GetItemCount("itemName"), GetItemCount("itemName",true) and GetItemCount("itemName",false) all return the number of items that are in both. This is a bug, correct?
Is there an API call in _classic_ that I don't know about that gives just the count in your bags?
I just tested it out, and it's working fine for me in Classic.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh
Is there an API call in _classic_ that I don't know about that gives just the count in your bags?
I found one but it's ugly...
Code:
local bags = {0,1,2,3,4}
for _, container in pairs(bags) do
for i = 1, GetContainerNumSlots(container), 1 do
local item = GetContainerItemLink(container, i)
if item then
local _,count = GetContainerItemInfo(container, i)
...
I just did a quick test with a few things using item names. Yes, I had items in both the bag and bank.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh