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.13k forks source link

Sometimes when turning passengers do not rotate with vehicle. #52264

Open ProfoundDarkness opened 2 years ago

ProfoundDarkness commented 2 years ago

Describe the bug

Sometimes (rarely for me) while driving I'll have the passengers of the vehicle remain in place while the vehicle rotates. This puts the controls outside of my reach.

Steps To Reproduce

  1. From new world/save, go outside and spawn in a vehicle, ideally a 3 seater, I used an electric car in my tests.
  2. Alter character stats to be good at driving (10 is enough for some reliability/extra vehicle control, I have it happen sometimes at 6 or 7.)
  3. Spawn in/befriend 3 NPCs (this can take some doing/time).
  4. Get onto vehicle controls seat.
  5. Wait for all three remaining seats to be filled by NPCs. (I also close the doors if they left them open).
  6. put vehicle in reverse (-4 mph).
  7. rotate vehicle direction 1 step clockwise (direction will be vehicle moving backwards mostly south with a little west). Since I have reversed turning direction when vehicles are in reverse enabled I press right arrow.
  8. skip one turn (vehicle travels 1 tile)
  9. now rotate vehicle direction three steps clockwise (same direction as in step 7).
  10. On the third input the vehicle should have rotated to now mostly be moving west, backwards.
  11. Observe player is no longer sitting at controls, in fact passengers of vehicle are as they were pre-rotation.

Expected behavior

For the passengers to rotate with the vehicle and not loose control of the vehicle (among all the other issues that pop up from this).

Screenshots

No response

Versions and configuration

Additional context

I've included a save which should just require picking up from step 9. Test_Strange_Veh_Swap_Seat.zip

This one took me some time to figure out... Partially because at first it was kind of random but then when my driving skill got higher (yeah I let it keep training some) I could start to make it happen more. Skill 10 seems to be good enough, go 20 for more reliability I suppose. One key was the full rotation of the cabin going from square in one direction to square in another.

I'm not sure if 3 NPCs are required. I tried a non-exhaustive list of other options and didn't get it to happen...

Counterclockwise doesn't seem to cause it. Tried similar maneuvers moving forward (+4mph) both clockwise and counterclockwise with no errors... for whatever reason this is specific to reverse with clockwise direction change. I also tried other compass directions in reverse and it only happened with the clockwise rotation described.

So far the best way to recover from this involves waiting until the vehicle stops wherever you've ended up. Attempting to exit the vehicle tends to result in being hurt, trying to swap places with an NPC tends to result in their death since none of them are where they think they are.

If you don't alt-F4 out, be prepared for a ton of errors (mentioned below) until you've managed to get all the NPCs fully out of the vehicle. May also require getting them back in again... Errors after this happens being: map::board_vehicle: passenger (NPC) is already there map::unboard_vehicle: passenger not found map::unboard_vehicle: vehicle not found These aren't actually bugs but that the game got into a bad state from THIS bug.

hexagonrecursion commented 2 years ago

Confirmed by using your save file. Thank you.

When moving after the bug is triggered I also get:

16:21:10.526 ERROR : src/map.cpp:1038 [void map::board_vehicle(const tripoint&, Character*)] map::board_vehicle: passenger (Clifford Busch) is already there
16:22:15.812 ERROR : src/map.cpp:1038 [void map::board_vehicle(const tripoint&, Character*)] map::board_vehicle: passenger (Concha Ragland) is already there
16:22:19.997 ERROR : src/map.cpp:1038 [void map::board_vehicle(const tripoint&, Character*)] map::board_vehicle: passenger (Avery Lawson) is already there
hexagonrecursion commented 2 years ago

@wapcaplet Confirmed