whitep4nth3r/pantherworld

[bug] cooking items doesn't remove them from inventory

Closed this issue · 2 comments

!cook fresh pasta + garlic bulb + fresh red chilli + fresh green chilli

didn't remove any of those from my inventory (matty_twoshoes)

observed earliest 2024-08-14 20:00:00 UTC

suggestion for part of bugfix: delete all cooked items from 2024-08-14 00:00:00 UTC onwards and "gifting" everyone a set of ingredients would be the fairest way to restore confidence in cooking

The issue was how we were selecting items to update in the DB.

The DB query was looking for the "first" item by name, regardless of whether or not it was already spoiled or used.

This meant than when cooking, if you had more than one of e.g. stick of butter previously, and cooked with the stick of butter, the DB would always find the used one and attempt to set that to used, and would never find the second one to set that to used.