Bug - consume item even on cooldown

So there is a bug in current system when trying to use consumable item when its on cooldown. I think its more of an issue of implementation of abilities than inventories.

Here is my quick solution for this in ActionStore.cs (ofc you need to modify return type in Ability.cs to bool)

public bool Use(int index, GameObject user)
        {
            if (dockedItems.ContainsKey(index))
            {
                bool succeeded = dockedItems[index].item.Use(user);
                if (succeeded && dockedItems[index].item.isConsumable())
                {
                    RemoveItems(index, 1);
                }
                return true;
            }
            return false;
        }
3 Likes

A good solution there.

Privacy & Terms