Hi,
I ran into this crash when I experimented with the minimum PAK file setup.
If no road objects are present in the pak, wegbauer_t::get_earliest_way will return a NULL pointer and calls a member function without checking the pointer.
game_start = max( game_start, (wegbauer_t::get_earliest_way(road_wt)->get_intro_year_month()+11)/12 );
I have no idea what exit code to use, but the magic number 11 was used earlier in a similar situation.
Just because a PAK file with a given filename exists and loads, doesn't mean that all vital objects are included in it.
Without knowing to much about the code, the test should probably be done already after all PAK files has been loaded and all vital object should be tested, not only the filenames. I'm I right?
A minimum pak must contain a road, otherwise it cannot generate cities. A random road is a requirement for a minimum pak. That should generate a meaningful fatal error indeed.
Yes, that was the question I raised. A PAK should have at least one road but as long users are compiling thir own PAKs it is not guaranteed that everything that is needed is there.
In these cases a message should state what object is missing instead of crash.
I think the best approach would be to first load all PAK files then , in one place, check if all vital objects has been loaded and present a list of missing objects. This would help newcomers, as myself, a lot.
I saw a note in rev 6475 SVN log "Warning message when no default road is found". I interpret this as the implemented version of this path...
Well, no, it is implemented in wegbauer, which should take care of all ways.
I interpret this as my patch is obsolete now, I'm I right? :)
yes. It served as a trigger to fix this problem nevertheless. :)
Good :)
So this should be moved to resolved bugs then...
So we have a happy end. :D