I do not think the save is corrupt, rather there is a fatal bug that manifests itself almost immediately after load. Someone will have to debug it...
Edit:
Stack trace below...
Exception thrown: read access violation.
this was nullptr.
> Simutrans-Extended Normal x64 Debug (SDL 2).exe!strasse_t::get_overtaking_mode() Line 57 C++
Simutrans-Extended Normal x64 Debug (SDL 2).exe!road_vehicle_t::can_enter_tile(const grund_t * gr, int & restart_speed, unsigned char second_check_count) Line 3655 C++
Simutrans-Extended Normal x64 Debug (SDL 2).exe!vehicle_t::hop_check() Line 1640 C++
Simutrans-Extended Normal x64 Debug (SDL 2).exe!vehicle_base_t::do_drive(unsigned int distance) Line 372 C++
Simutrans-Extended Normal x64 Debug (SDL 2).exe!convoi_t::sync_step(unsigned int delta_t) Line 1312 C++
Simutrans-Extended Normal x64 Debug (SDL 2).exe!karte_t::sync_list_t::sync_step(unsigned int delta_t) Line 4661 C++
Simutrans-Extended Normal x64 Debug (SDL 2).exe!karte_t::sync_step(unsigned int delta_t, bool do_sync_step, bool display) Line 4724 C++
Simutrans-Extended Normal x64 Debug (SDL 2).exe!interrupt_check(const char * caller_info) Line 112 C++
Simutrans-Extended Normal x64 Debug (SDL 2).exe!karte_t::step() Line 5488 C++
Simutrans-Extended Normal x64 Debug (SDL 2).exe!karte_t::interactive(unsigned int quit_month) Line 10570 C++
Simutrans-Extended Normal x64 Debug (SDL 2).exe!simu_main(int argc, char * * argv) Line 1384 C++
Simutrans-Extended Normal x64 Debug (SDL 2).exe!sysmain(int argc, char * * argv) Line 826 C++
Simutrans-Extended Normal x64 Debug (SDL 2).exe!WinMain(HINSTANCE__ * __formal, HINSTANCE__ * __formal, char * __formal, int __formal) Line 793 C++
[External Code]
In road_vehicle_t::can_enter_tile the local variable current_str is null.
I am guessing this is a bug with the overtaking patch. It probably only manifested itself now because someone actually bothered to use one of the many overtaking or direction limited road mechanics other than the default.
// When overtaking_mode changes from inverted_mode to others, no cars blocking must work as the convoi is on traffic lane. Otherwise, no_cars_blocking cannot recognize vehicles on the traffic lane of the next tile.
//next_lane = -1 does NOT mean that the vehicle must go traffic lane on the next tile.
const strasse_t* current_str = (strasse_t*)(welt->lookup(get_pos())->get_weg(road_wt)); // THIS IS NULL
if( current_str && current_str->get_overtaking_mode()==inverted_mode ) {
if( str->get_overtaking_mode()<inverted_mode ) {
next_lane = -1;
}
}
if( current_str->get_overtaking_mode()<=oneway_mode && str->get_overtaking_mode()>oneway_mode ) {
next_lane = -1;
}
The error appears to be that the second conditional test is not testing that current_str is non null like the first conditional test is. It can pass the first conditional test if NULL but will crash with a null pointer dereference with the second test.
In case someone wants to blame a person for it (joking, this would be more for interest) the details of which vehicle is causing the crash are below.
x = 6102
y = 3237
owner_n = 3
name_and_id = "(5015) Clydesdale horse (single)"
Apparently this was one of my horses! I have not touched that area of the map for decades...
Also the tile it was on was not a road? Very strange.
I tested the following fix and it appears to prevent the crash. If this does not cause other bugs I do not know.
// When overtaking_mode changes from inverted_mode to others, no cars blocking must work as the convoi is on traffic lane. Otherwise, no_cars_blocking cannot recognize vehicles on the traffic lane of the next tile.
//next_lane = -1 does NOT mean that the vehicle must go traffic lane on the next tile.
const strasse_t* current_str = (strasse_t*)(welt->lookup(get_pos())->get_weg(road_wt));
if( current_str ) {
const overtaking_mode_t current_overtake_mode = current_str->get_overtaking_mode();
if( current_overtake_mode==inverted_mode ) {
if( str->get_overtaking_mode()<inverted_mode ) {
next_lane = -1;
}
}
if( current_overtake_mode<=oneway_mode && str->get_overtaking_mode()>oneway_mode ) {
next_lane = -1;
}
}