Re: Infinite, Stackable Inventory/Crafting/Vendor - UPDATED v1.5
Posted: Mon Mar 20, 2023 5:17 pm
Ended up having an issue when I tried to implement crafting and recipes, but it was solved via this other thread. (thanks to _ticlock_!)
In short, I was getting the error
It's solved by making a slight change to def qty:
In short, I was getting the error
Code: Select all
TypeError: '>=' not supported between instances of 'NoneType' and 'int'
Code: Select all
def qty(self, item):
for i in self.inv:
if i[0] == item:
return i[1] # returns quantity
return 0 # returns zero if no item in the inventory