Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crafting menu does not recognize Survivor toolbelt qualities when belt is in inventory #43248

Closed
slitherrr opened this issue Aug 26, 2020 · 9 comments
Labels
<Bug> This needs to be fixed Crafting / Construction / Recipes Includes: Uncrafting / Disassembling

Comments

@slitherrr
Copy link
Contributor

Describe the bug

When I have a survivor utility belt in my inventory (either worn or not), I am unable to perform the Improvised Lockpick craft, and the metal sawing 2 requirement is highlighted red. When I drop the belt and try the craft after doing so, I am able to perform the craft. If I pick the belt back up, I am once again unable to perform it.

Steps To Reproduce

  1. Create a survivor utility belt from a survivor belt and the various tools (screwdriver set, wrench, hacksaw, wood saw, hammer)
  2. Gather materials for the improvised lockpick recipe scrap metal version (1 scrap metal. Note that the "2 wires" version does not require metal sawing and thus does not cause this behavior).
  3. Ensure no other tools are present.
  4. Put the survivor utility belt in inventory and attempt the improvised lockpick craft. Note it is unavailable, and note that its "metal sawing 2" requirement is in red text.
  5. Drop the survivor utility belt and attempt the craft. Note that it is now available.

Expected behavior

I would expect the metal sawing 2 quality to be available as long as the tool is in reach, regardless of whether it is in my personal inventory or elsewhere.

Screenshots

image
image

Do not take a screenshot of the crashing window. Please provide the crash logs in the "Additional context" -->

Versions and configuration

  • OS: Windows 10 x64
  • Game Version: 0.E-5407-g8b385a2 and 0.E-5332-g39272e1
  • Graphics version: Tiles
  • Ingame language: English (US)
  • Mods loaded: DDA, Disable NPC Needs, Blaze Industries, Aftershock, Magiclysm, No Fungal Monsters
@mqrause
Copy link
Contributor

mqrause commented Aug 26, 2020

The code says // can't craft with containers that have items in them, so the reason is you have a knife sheathed in the belt. It doesn't really make sense for items used as tools, though. Plus this check is missing for items you don't carry or wear, which is why it works when you drop the belt.

@danielkwinsor
Copy link
Contributor

Happens with butchering too, where the reported butchering level may be invalid, when the best tool is stored in a container.

@mqrause
Copy link
Contributor

mqrause commented Aug 27, 2020

@danielkwinsor Can you make a separate issue for that with steps to reproduce it? Butchering works different than crafting, so it requires a different fix.

@slitherrr
Copy link
Contributor Author

(for drive-bys, mqrause is referring to the section here: https://github.com/CleverRaven/Cataclysm-DDA/blob/master/src/crafting.cpp#L558-L564)

That does make sense. Well, from a code standpoint at least, it's silly from a logic standpoint.

@wapcaplet
Copy link
Contributor

wapcaplet commented Aug 29, 2020

Possibly related to #42702 #42448 and #40973

@anothersimulacrum anothersimulacrum added <Bug> This needs to be fixed Crafting / Construction / Recipes Includes: Uncrafting / Disassembling labels Aug 29, 2020
@bouchacha
Copy link

bouchacha commented Aug 29, 2020

(for drive-bys, mqrause is referring to the section here: https://github.com/CleverRaven/Cataclysm-DDA/blob/master/src/crafting.cpp#L558-L564)

That does make sense. Well, from a code standpoint at least, it's silly from a logic standpoint.

Is there an elegant solution? I'm not a programmer so please excuse if any of this is fanciful. Seems like that check should only apply to "container" containers (e.g. cooking pots, metal tanks, etc.) and nothing else (e.g. survivor toolbelts). Does this mean the only solution is manually editing every single item with a new attribute "can only be used when empty"? That sounds maybe tedious, but is probably best for the long run. The other thing that comes to mind is the check you linked to only triggers when a recipe requires either of the following:

  • food cooking
  • chemical making
  • boiling
  • containing
    I think that would probably approximate the solution, but then there are recipes where this won't make sense. For example, thyme oil requires boiling of 2 and hammering of 1.

Edit: OR how about just checking if the tool can carry liquids first then checking if it's empty. It would make sense that if you want to use a pot full of water to cook, you'd need to empty it first (and therefore choose the ground or another container). But if the pot happens to be full of dry beans, then it's trivial to take the beans out temporarily.

@mqrause
Copy link
Contributor

mqrause commented Aug 30, 2020

Is there an elegant solution?

Definitely. It just needs a proper definition of all the expected behavior. It's not necessarily something you just slap a solution on for whatever item you come across.

@Icantthinkofanameforthis

Could a solution be adding the qualities of the container to the contained items qualities? like it thinks its holding itself plus anything put into it.

@Night-Pryanik
Copy link
Contributor

Can't confirm on 0.E.-10390.

изображение

изображение

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bug> This needs to be fixed Crafting / Construction / Recipes Includes: Uncrafting / Disassembling
Projects
None yet
Development

No branches or pull requests

8 participants