Re: [Q] Vehicle replacement and vehikel_search
Reply #2 –
Thank you for explain it.
But current code is powerless to avoid crash.
If matching vehicle can't be found, the code below always causes crash because of wrong file pointer and can't continue loading a game.
// no matching vehicle found?
if(v->gib_besch()==NULL) {
// will create orphan object, but better than crashing at deletion ...
dbg->error("convoi_t::convoi_t()","Can't load vehicle and no replacement found!");
i --;
continue;
}
So, to prevent crashes (because this is the purpose of replacement), it must find something whether it is good one or not.
This is what I wanted to say. I don't need better vehikel_search but need crashless loading with missing vehicles.