whitep4nth3r / pantherworld

View your p4nth3rworld inventory, read the manual, and more!
https://p4nth3r.world
21 stars 6 forks source link

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

Closed matthewbrandt closed 2 months ago

matthewbrandt commented 2 months ago

!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

whitep4nth3r commented 2 months ago

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.

whitep4nth3r commented 2 months ago

Fixed by https://github.com/whitep4nth3r/p4nth3rb0t-mainframe/pull/173