CleverRaven / Cataclysm-DDA

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

Excessive <Nonexistent vehicle type: ""> on character template usage #43217

Closed Valares closed 2 years ago

Valares commented 4 years ago

Describe the bug

Using the "Character to Template" function on an existing character in an existing world generates a template with an invalid starting car but does not generate an error. However, if that template is chosen, it will throw the following errors on loading into the world:

  DEBUG    : Nonexistent vehicle type: ""

  FUNCTION : vehicle* map::add_vehicle(const vproto_id&, const tripoint&, int, int, int, bool)
  FILE     : src/mapgen.cpp
  LINE     : 5869

And it does so - going by a newly generated debug.log file - 2253 times!

It follows that up by this error:

 DEBUG    : could not place starting vehicle

 FUNCTION : bool game::start_game()
 FILE     : src/game.cpp
 LINE     : 834

After that, the game loads and plays - as far as I can tell - without issues.

Steps To Reproduce

  1. Generate a world and a character in that world.
  2. Save and Quit.
  3. Go to "World", select the generated world, and select "Character to Template".
  4. Reset the world, generate a new one or use the existing world and go to "New Game", "Preset Character" and select your template and world.
  5. Finish your character generation.
  6. Experience the errors.

Expected behavior

The game to load with no error messages.

Versions and configuration

Additional context

As far as I'm concerned, there are two bugs:

  1. The template generator generating an invalid car (and/or the script can't handle ""),

This's probably going to be easy to fix.

  1. The script trying to load/find that invalid car 2253 times.

In doing so, it might also generate a large portion of the map, as using the overmap editor or just going by the generated auto-notes shows. My guess is, the game tries to generate that inexistant vehicle type at any place it thinks it might could hold it, causing a - probably variable but still - excessive amount of "nonexistant" error messages along the way.

Fris0uman commented 4 years ago

related to #43141

wapcaplet commented 4 years ago

Confirmed in 0.E-6177-g 9f4a1b841d