CleverRaven / Cataclysm-DDA

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

Broken dialog for selecting installable parts #73871

Open IdleSol opened 1 month ago

IdleSol commented 1 month ago

Describe the bug

While checking bug #73868, noticed that the game doesn't offer to choose which battery to install.

- On version cdda-windows-tiles-x64-2024-05-16-0649 the game offers to choose one of two accumulators. - On version cdda-windows-tiles-x64-2024-05-16-1817 it does not.

The problem is a bit more complicated than it initially appeared. Most likely only applies to the batteries, not any part. And I'm not really sure what's going on. I'll try to figure it out and post in a second post.

Attach save file

n/a

Steps to reproduce

see 2nd post

Expected behavior

n/a

Screenshots

No response

Versions and configuration

cdda-windows-tiles-x64-2024-05-16-1817

Additional context

No response

IdleSol commented 1 month ago

Here's what I tried and what it resulted in.

  1. If you create a car and two batteries. Then when you try to install a battery, the selection works.
  2. If after installing a battery (its charge disappears), the same battery is removed from the vehicle. You get one charged and one discharged battery in the inventory. We try to put the battery in the car, then there is no choice dialog. The battery with 0 charge is always selected.
  3. Assumption that batteries with different charge are considered as different items. And since they are in one instance, the selection is skipped. The result is strange.
    • 2 batteries (3k/3k) + 1 battery (0/3k) = automatic selection of battery with no charge
    • 1 battery (3k/3k) + 2 batteries (0/3k) = dialog to select from 2 batteries (0/3k)
    • 1 battery (3k/3k) + 2 batteries (0.5k/3k) = select from 3 batteries

Battery without charge != battery with charge ? Also, instead of 3 batteries, I got 5. (UPD. Could not reproduce the battery duplication)

Steps to reproduce

  1. Create a default world
  2. Spawn any vehicle
  3. Spawn two batteries (1 battery (3k) installed in car and 2 batteries (3k) in inventory)
  4. Install a battery in the car
  5. Note, the dialog prompts you to choose between two batteries 3k
  6. Remove the battery that has lost its charge
  7. There is 1 battery (3k) and 1 battery (0k) in your inventory
  8. Install the battery in the machine
  9. Note, the game does not ask you which battery to install. The 0k is used. Note. I tried different battery placement. When both are in inventory, when both are on the ground, or one in inventory and one on the ground. I have always used 0k.
  10. Put all the batteries in the car. And remove them. You will get 1 battery (3k) and 2 batteries (0k)
  11. Install the battery in the car.
  12. Note, the game asks which of the two batteries (0k) should be installed
  13. Install all batteries without charging
  14. Change the charge of the batteries in the vehicle (+1000 or +500 per battery)
  15. Remove batteries from vehicle and get: 1x3k + 2x0.5k
  16. Install the battery in the transport
  17. Note, the game offers to choose one of three batteries.

UPD. For versions of the game prior to 2024-05-16-1817, you must use the debug menu to get the battery uncharged (step 7. ... 1 battery (0k)...)

osuphobia commented 1 month ago

I think #70360 is relevant.

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