Originally Posted by circonian
But, Is there a reason you don't just check the inventory slots table instead of calling GetItemType and comparing it to see if its ITEMTYPE_NONE?
Wouldn't that be even faster?
|
No particular reason. GetItemType is what I learned first, is easy to remember and also shorter, dunno about speed
Although if you wanted to use pre-cached slot data, you should probably use SHARED_INVENTORY:GenerateSingleSlotData. That's what PLAYER_INVENTORY.inventories[iInventory].slots are initialized with:
Lua Code:
-- ingame/inventory/inventory.lua
inventory.slots[slotIndex] = SHARED_INVENTORY:GenerateSingleSlotData(bagId, slotIndex)