Maybe not a bug, just an unwanted (by me) default action...
I'm trying to track down an error causing a crash. This is not the cause, but its something I noticed when trying to tack down the problem. In my code I have been checking to see if an item exists in a bag/slot by checking the itemType before attempting to do anything with the item. If it came back ITEMTYPE_NONE I assumed the item was moved, destroyed, sold,
or I assumed it was just an invalid bag/slot passed in.
But I just found out that
- If the slotIndex is nil, like: GetItemType(1, nil) it seems to use slot 0 for that bag.
- If the bag is nil: GetItemType(nil, 33) it seems to default to bag 0
- If the bag is an erroneous number: GetItemType(12343224, nil) it is defaulting to bag 1.
Is there any other way to verify if the values for bag/slot are valid & correspond to an actual item that still exists in that bag/slot?
(besides tediously checking the bag# & slot# against the available bags & slots)