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

pick_one_up attempts to put items into blocked pockets #57635

Open
Nerezza opened this issue May 11, 2022 · 2 comments
Open

pick_one_up attempts to put items into blocked pockets #57635

Nerezza opened this issue May 11, 2022 · 2 comments
Labels
Items: Containers Things that hold other things (S2 - Confirmed) Bug that's been confirmed to exist

Comments

@Nerezza
Copy link
Contributor

Nerezza commented May 11, 2022

Describe the bug

Finally figured out roughly what's going on here:
If your pockets are all full except for ones either not permitted to be auto-filled, or ones blacklisting the target item, pick_one_up from the 'g' grab item menu will still assume you have a valid pocket to insert the item into.

item::fill_with will them issue a debug message and your character will unceremoniously drop the triggering item on their next turn.

Steps to reproduce

Wear two leather pouches, block one of them from auto-inserting items.
Fill the unblocked pouch to capacity
Attempt to pick up one more item with 'g'

Expected behavior

Either the pickup menu should check for pockets items are allowed into, or whichever function calls item::fill_with should return and give the message a log stating no valid pockets remain.

Screenshots

No response

Versions and configuration

  • OS: Windows
    • OS Version: 10.0.19042.1415 (20H2)
  • Game Version: c1e2b3c [64-bit]
  • Graphics Version: Tiles
  • Game Language: System language []
  • Mods loaded: [
    Dark Days Ahead [dda],
    Disable NPC Needs [no_npc_food],
    No Fungal Growth [no_fungal_growth],
    SpeedyDex [speedydex],
    Stats Through Skills [StatsThroughSkills],
    Bionic Slots [cbm_slots]
    ]

Additional context

   (dbghelp: @0x7ff7cdc966e0[cataclysm-tiles.exe+0x2066e0]), 
   (libbacktrace: debug_write_backtrace(std::ostream&)+0x9e@0x1402066e0),
   (libbacktrace: 0x1402066e0    [unknown src]:0    [unknown func]),
 #1
   (dbghelp: @0x7ff7cdc978c0[cataclysm-tiles.exe+0x2078c0]), 
   (libbacktrace: DebugLog(DebugLevel, DebugClass)+0x20e@0x1402078c0),
   (libbacktrace: 0x1402078c0    [unknown src]:0    [unknown func]),
 #2
   (dbghelp: @0x7ff7cdc98920[cataclysm-tiles.exe+0x208920]), 
   (libbacktrace: realDebugmsg(char const*, char const*, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)+0x1ac@0x140208920),
   (libbacktrace: 0x140208920    [unknown src]:0    [unknown func]),
 #3
   (dbghelp: @0x7ff7ce8a3c14[cataclysm-tiles.exe+0xe13c14]), 
   (libbacktrace: void realDebugmsg<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>(char const*, char const*, char const*, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)+0xa4@0x140e13c14),
   (libbacktrace: 0x140e13c14    [unknown src]:0    [unknown func]),
 #4
   (dbghelp: @0x7ff7cde73dfd[cataclysm-tiles.exe+0x3e3dfd]), 
   (libbacktrace: item::fill_with(item const&, int, bool, bool, bool)+0x2e1@0x1403e3dfd),
   (libbacktrace: 0x1403e3dfd    [unknown src]:0    [unknown func]),
 #5
   (dbghelp: @0x7ff7cdbea817[cataclysm-tiles.exe+0x15a817]), 
   (libbacktrace: outfit::pickup_stash(item const&, int&, bool)+0x57@0x14015a817),
   (libbacktrace: 0x14015a817    [unknown src]:0    [unknown func]),
 #6
   (dbghelp: @0x7ff7ce2a502b[cataclysm-tiles.exe+0x81502b]), 
   (libbacktrace: pick_one_up(item_location&, int, bool&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<item, int>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::pair<item, int> > > >&, bool, bool&)+0x651@0x14081502b),
   (libbacktrace: 0x14081502b    [unknown src]:0    [unknown func]),
 #7
   (dbghelp: @0x7ff7ce2a53bc[cataclysm-tiles.exe+0x8153bc]), 
   (libbacktrace: Pickup::do_pickup(std::vector<item_location, std::allocator<item_location> >&, std::vector<int, std::allocator<int> >&, bool, bool&)+0x16d@0x1408153bc),
   (libbacktrace: 0x1408153bc    [unknown src]:0    [unknown func]),
 #8
   (dbghelp: @0x7ff7cdab0e41[cataclysm-tiles.exe+0x20e41]), 
   (libbacktrace: pickup_activity_actor::do_turn(player_activity&, Character&)+0xeb@0x140020e41),
   (libbacktrace: 0x140020e41    [unknown src]:0    [unknown func]),
 #9
   (dbghelp: @0x7ff7ce2a979b[cataclysm-tiles.exe+0x81979b]), 
   (libbacktrace: player_activity::do_turn(Character&)+0x2b1@0x14081979b),
   (libbacktrace: 0x14081979b    [unknown src]:0    [unknown func]),
 #10
   (dbghelp: @0x7ff7cdcdfc56[cataclysm-tiles.exe+0x24fc56]), 
   (libbacktrace: do_turn()+0x327@0x14024fc56),
   (libbacktrace: 0x14024fc56    [unknown src]:0    [unknown func]),
 #11
   (dbghelp: @0x7ff7cef6f54d[cataclysm-tiles.exe+0x14df54d]), 
   (libbacktrace: main+0x18fb@0x1414df54d),
   (libbacktrace: 0x1414df54d    [unknown src]:0    [unknown func]),
 #12
   (dbghelp: @0x7ff7cda913c1[cataclysm-tiles.exe+0x13c1]), 
   (libbacktrace: _tmainCRTStartup+0x231@0x1400013c1),
   (libbacktrace: 0x1400013c1    /opt/mxe/tmp-gcc-x86_64-w64-mingw32.static.gcc11/gcc-11.2.0.build_/mingw-w64-v9.0.0/mingw-w64-crt/crt/crtexe.c:323    __tmainCRTStartup),
 #13
   (dbghelp: @0x7ff7cda914d6[cataclysm-tiles.exe+0x14d6]), 
   (libbacktrace: WinMainCRTStartup+0x16@0x1400014d6),
   (libbacktrace: 0x1400014d6    /opt/mxe/tmp-gcc-x86_64-w64-mingw32.static.gcc11/gcc-11.2.0.build_/mingw-w64-v9.0.0/mingw-w64-crt/crt/crtexe.c:178    WinMainCRTStartup),
 #14
   (dbghelp: BaseThreadInitThunk+0x14@0x7ff8f1bc7034[KERNEL32.DLL+0x17034]), 
   (backtrace_syminfo failed: errno = -1, msg = no symbol table in PE/COFF executable),
   (backtrace_pcinfo failed: errno = -1, msg = no debug info in PE/COFF executable),
 #15
   (dbghelp: RtlUserThreadStart+0x21@0x7ff8f1ec2651[ntdll.dll+0x52651]), 
   (backtrace_syminfo failed: errno = -1, msg = no symbol table in PE/COFF executable),
   (backtrace_pcinfo failed: errno = -1, msg = no debug info in PE/COFF executable),
Backtrace emission took 0 seconds.
(continued from above) ERROR : src/item.cpp:11694 [int item::fill_with(const item&, int, bool, bool, bool)] tried to put an item (corn, amount 1) in a container (armor_nomad_advanced_on) that cannot contain it
16:14:30.639 ERROR : src/item.cpp:11694 [int item::fill_with(const item&, int, bool, bool, bool)] tried to put an item (corn, amount 1) in a container (armor_nomad_advanced_on) that cannot contain it```
@mqrause
Copy link
Contributor

mqrause commented May 11, 2022

Cataclysm-DDA/src/item.h

Lines 1531 to 1534 in aa6a7f8

ret_val<bool> can_contain( const item &it, const bool nested = false,
const bool ignore_rigidity = false,
const bool ignore_pkt_settings = true,
const item_location &parent_it = item_location() ) const;

The reason is that item::can_contain ignores pocket settings by default. Not sure what the best way to fix it is. item::can_stash checks the settings so maybe it's enough to use that instead.

@aleksandrtikh
Copy link

#57643 might be related, as it also deals with putting items where you should not be able to when there's no space.

@Maleclypse Maleclypse added Items: Containers Things that hold other things (S2 - Confirmed) Bug that's been confirmed to exist labels Jun 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Items: Containers Things that hold other things (S2 - Confirmed) Bug that's been confirmed to exist
Projects
None yet
Development

No branches or pull requests

4 participants