CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.53k stars 4.16k forks source link

Autopickup Grabs Containers #65117

Closed chaoticidealism closed 1 year ago

chaoticidealism commented 1 year ago

Describe the bug

When autopickup is set to pick up an item, and that item happens to be inside a container, and you can pick up the container, then you pick up the container.

This can be a problem if, for example, I set autopickup to grab smartphones--because I quickly find that my character has also picked up the filthy jeans in which the zombies were storing the smartphones. And the filthy backpacks in which the zombies were storing the smartphones. And then my backpack fills up and I don't get any more smartphones.

(Smartphones are a good example here because they have both watertight cases you want to pick up, and are found in clothing you don't want to pick up.)

Attach save file

n/a

Steps to reproduce

  1. Set autopickup to pick up an item that tends to be found in containers. Make sure you have space in your inventory.
  2. Walk around and observe what you pick up. It tends to happen when the item you want is the only item in its container and when you have space in your inventory for the container itself. It doesn't always seem to happen, but it sometimes does. Best way to make it happen for sure is to kill off a horde and walk around on the bodies.

Expected behavior

If I want to pick up smartphones, then I should pick up smartphones, and probably also the smartphone cases they're stored in, but not the dirty jeans. If they know the smartphone is there, then they should reach into the jeans and grab the phone itself. If they're looking for bandages, they should open up the first-aid kit and grab the bandages out of it.

This might be complex to code, because sensible behavior also dictates that my character, if I set them to pick up all cigarettes, or all candy, should pick up the entire pack or bag instead of emptying it. If they're set to pick up aspirin, they should pick up the bottle as well instead of emptying it.

But in some of these extreme cases, it makes no sense to pick up the entire container.

It's probably better to have the autopickup grab items from containers by default, unless the container is watertight and the item is harmed by water. A few loose cigarettes and candies aren't the end of the world.

Screenshots

n/a

Versions and configuration

Additional context

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not bump or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.