twohoursonelife / twotech

Automated Crafting Guide for Two Hours One Life
https://twotech.twohoursonelife.com
MIT License
3 stars 7 forks source link

Flower pots unexpectedly showing as an infinite tool #52

Open connorhsm opened 3 months ago

connorhsm commented 3 months ago

image Suspected due to these transitions image

Possibly happening elsewhere for past items.

https://github.com/twohoursonelife/twotech/blob/0b5d78969a244bc2e8e76ea17a14a76cfbd95ca6/process/src/GameObject.js#L216-L221

connorhsm commented 3 months ago

Yes, likely a long-standing issue

image image

image image

connorhsm commented 3 months ago

Related https://github.com/twohoursonelife/twotech/blob/73d2caff53870e62a3c57ad6681c3d390a215f3b/process/src/Transition.js#L36

TanyaPegasus commented 3 months ago

Whether an item is a tool is defined by the processor, rather than the game, so there isn't a simple check we can do to filter these items. The simplest way to resolve this would be to remove the category, however I think there is a use case for this. It may be utilised more often if it was working as intended, especially for new players.

The processor is checking that the actor ID is >= 0, and then that the actor ID is the same as the new actor ID. If we added an additional check for whether the object has a percentage use chance. This would catch all tools like shovels etc, but not flowerpots. Similar code can be seen here, being used to calculate uses: https://github.com/twohoursonelife/twotech/blob/73d2caff53870e62a3c57ad6681c3d390a215f3b/process/src/ObjectBadges.js#L31-L33

Objects this would affect that we may not want it to effect: Rolling pin Watering can Bucket Stomper Bone needle Needle and ball of thread Knitting needles Fire bow drill Flint tipped bow drill Firebrand Short shaft Straight shaft Sharp stone stone Blueprinrt Pencil

Some items that are already being filtered out by the current code, which should possibly be included: Stakes Fishing pole Wooden tongs Spinning wheel

While not ideal, one solution would be to implement the check I suggested above, as well as a whitelist of objects that we have selected, that should be included.