Cataclysm-BN
Cataclysm-BN copied to clipboard
Item locations invalidated when dropping cash cards right after making deposit (also there is undefined behaviour somewhere)
Describe the bug
I have a save with a character with 18 cash cards and two-way radio.
So if I deposit all money at ATM then drop all cash cards, somehow 2 cash cards remain in inventory but radios battery gets dropped into ground.
If I turn on debug mode, game just crashes after dropping few of cards.
Steps To Reproduce
Drop invalid items:
- Load provided save.
- Deposit all money using ATM.
- Drop your cash cards.
- Check inventory and see 2 cash cards remain.
- Check floor and see battery or other not-selected item dropped.
Get crash.
- Load provided save.
- Enable debug mode.
- Deposit all money using ATM.
- Drop your cash cards.
- Game crashes.
Expected behavior
Drop only requested items and don't crash if debug mode enabled.
Screenshots
No response
Versions and configuration
- OS: Windows
- OS Version: 10.0 2009
- Game Version: 81039bcb1e [64-bit]
- Graphics Version: Tiles
- Game Language: []
- Mods loaded: [ Bright Nights [dda], Elevated bridges [elevated_bridges], No Fungal Monsters [No_Fungi], Bionic Slots [cbm_slots] ]
Additional context
Sorry for such huge save but I failed to make smaller reproduction case. Kongiganak.zip
Crash is caused by calling item::display_name
on nullptr
at debug_drop_list
.
And item_locaton gets lost at somepoint between drop_activity_actor::do_turn
calls.
I suppose, those missing items substituted by other items in player inventory.
Probably related to #1140.