Happy-Pixels
Happy-Pixels copied to clipboard
function DataToColor:itemName(bag, slot) in addon DataToColor.lua errors when bag item stack size is 200
Hi good job on the tutorial and code,
This function: function DataToColor:itemName(bag, slot) creates a number which is greater than 256256256 -1 (16777215) when a bag item has a stack size of 200.
e.g. wicked-throwing-dagger = 15327, stack of 200. item = item + itemCount * 100000 item = 15327 + 200 * 100000 item = 20015327
This is the problem code: if(itemCount ~= nil and itemCount > 0) then item = item + itemCount * 100000 end
A possible solution might be to cap the stack size to 100: if(itemCount ~= nil and itemCount > 0) then if (itemCount>100) then itemCount=100 end item = item + itemCount * 100000 end