If you want to see if a unit has a multiple of an item, set up a function that returns boolean. Run checks for each of the slots to see if the item-type in it is the same as in any other slot and return true if you ever find a match if not at the end return false.
If you want to know how many of a type of item a unit has, count them (with a function of course). |