Beispiel #1
0
        public static int HasItem(int index, int itemNum)
        {
            int i = 0;

            // Check for subscript out of range
            if (C_Player.IsPlaying(index) == false || itemNum <= 0 || itemNum > Constants.MAX_ITEMS)
            {
                return(0);
            }

            for (i = 1; i <= Constants.MAX_INV; i++)
            {
                // Check to see if the player has the item
                if (C_Player.GetPlayerInvItemNum(index, i) == itemNum)
                {
                    if (Types.Item[itemNum].Type == (byte)Enums.ItemType.Currency || Types.Item[itemNum].Stackable == 1)
                    {
                        return(C_Player.GetPlayerInvItemValue(index, i));
                    }
                    else
                    {
                        return(1);
                    }

                    return(0);
                }
            }
            return(0);
        }