CleverRaven / Cataclysm-DDA

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

Diagonal vehicle storage allows item duplication #74850

Open HalcyonHal opened 3 months ago

HalcyonHal commented 3 months ago

Describe the bug

Items stored in a vehicle storage while the vehicle is diagonally extrapolated can be withdrawn infinitely after the vehicle changes orientation

Attach save file

Ryland-trimmed.tar.gz

Steps to reproduce

  1. While dragging a portable generator vehicle with a Stow Board storage, angle the vehicle such that there are 2 tiles of storage compartment. Sophie Andersen _2024-06-30T15-30-54

  2. place objects in secondary storage (I used "D" multidrop but I believe it would repro with / transfer as well, as / transfering items out also causes the bug)

  3. drag vehicle at a different angle such that the 2 storage compartments return to being a single compartment Sophie Andersen _2024-06-30T15-33-26

  4. repeat step 1

  5. Take, transfer, or Wear/wield objects from the second storage tile to generate this error

DEBUG : Tried removing item from object which did not contain it

FUNCTION : remove_item FILE : D:\a\Cataclysm-DDA\Cataclysm-DDA\src\visitable.cpp LINE : 552 VERSION : 1f74d2a

  1. Object remains in storage compartment, but wield/wear/take/transfer is successful, causing item duplication (including contents, if item is a container)

Expected behavior

I would expect both storage compartment tiles to share a single inventory and not allow split contents, as they are in fact a single storage compartment that is being drawn over 2 tiles to represent vehicle heading. If they did somehow have split contents, I would expect them to merge contents when moved and share a single max capacity. I would expect objects not to duplicate when withdrawn from either storage tile

Screenshots

backpack-ception! Sophie Andersen _2024-06-30T15-46-56

Versions and configuration

OS: Windows 11 Home version: 23H2 Build: 22631.3737 Game Version: cataclysm-DDA experimental build 2024-06-12-1519 Graphics: Tiles Ingame language: English mods loaded: dda, no_npc_food, personal_portal_storms, no_fungal_growth, MMA, generic_guns, stats_through_kills, StatsThroughSkills

Additional context

DEBUG : Tried removing item from object which did not contain it

FUNCTION : remove_item FILE : D:\a\Cataclysm-DDA\Cataclysm-DDA\src\visitable.cpp LINE : 552 VERSION : 1f74d2a

CoroNaut commented 3 months ago

Slightly different issue than #70081, but could probably be fixed at the same time as this.

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