crafting problem

You’re removing all the usable items from the inventory without checking if they are all useable.

You need to loop round once, just to check everything is ok, then remove them from the inventory.