CleverRaven / Cataclysm-DDA

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

Cannot put a “wheat–free deluxe sandwich” into a “zipper bag” #69294

Closed db48x closed 10 months ago

db48x commented 1 year ago

Describe the bug

This is surprising because the sandwich is half a cup, 0.64 lb, and has a max length of 1 inch, while the zipper bag holds up to 1 cup, 1.7 lbs, and 3 inches. Seems like it ought to fit. Or am I doing something wrong?

Attach save file

Gulf Breeze-trimmed.tar.gz

Steps to reproduce

In the attached save, attempt to (i)nsert a sandwich into a zipper bag. Both are in inventory. Try the gallon–sized bags too!

Expected behavior

Sandwich goes into bag.

Screenshots

Screenshot from 2023-11-12 00-50-31 Screenshot from 2023-11-12 00-51-04 Screenshot from 2023-11-12 01-07-09

Versions and configuration

Additional context

No response

GuardianDll commented 1 year ago

Your zipper bag in the almost full pocket - there is enough space for zipper bag, but not enough space for zipper bag with sandwich. Wield the bag, put a sandwich, and then try to put it into the backpack or where you need it

db48x commented 1 year ago

Oooh, I get it now. The zipper bag is inside a toolbelt or whatever, and the toolbelt cannot accomodate the size the zipper bag would expand to once the sandwich is inside.

Maybe it should just take the zipper bag out of its container first.

RAldrich commented 1 year ago

I think that having it auto remove/wield the nested container would run into problems when you consider the rest of the insertion code. I can see why you might desire that behavior when manually inserting like you are here, but what about when you 'g'et an item or are using the advanced inventory manager?

It would take an extra check or option to toggle the behavior. Which is maybe fine, but does add complexity to an already complicated system.

db48x commented 1 year ago

I am just talking about specifically when inserting an item into a container, which doesn’t or shouldn’t conflict with what it does when you get an item or use the advanced inventory manager. Once the container is chosen, it would then check to see if it would still fit in its parent container. If it would not, then it would remove it from the parent container, perform the insertion, and then either place the container back into inventory, drop it, or place it on a near–by flat surface, just like what happens when you finish crafting an item you cannot hold in inventory.

I haven’t yet looked at the code though, so possibly that would be more difficult to implement than I expect.

github-actions[bot] commented 11 months 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.