The copy of the shared random engine, kept and put back around the
look-ahead and in its test, is marked NOSONAR for S2245: nothing is
drawn from it for security. The entry name is made with std::format,
and the two new error messages use raw strings.
When a vehicle's .mmd had no cabNdefinition: for the cab being entered,
InitializeCab() dropped the current cab model and controls before it looked
for the entry, and CabChange() had already changed the cab number and reset
the brake and controller positions. The player was left in a dead cab.
- InitializeCab() looks for the entry first and leaves the current cab
untouched when it isn't there.
- CabChange() checks the .mmd before changing anything: no cab that way
means nothing changes; a missing middle cab is stepped over.
- Init() and moving to another vehicle load another defined cab in place
of a missing one, with an error line naming the missing entry.
- UpdateCab() keeps the loaded cab when the AI changes to a cab the .mmd
doesn't define, with one error line.
The look ahead restores Global.random_engine, so a random include set in
the .mmd draws the same as before. Vehicles defining all their cabs behave
as before. This makes it safe for single-desk vehicles such as the 401Da
to drop cab0definition: and cab2definition:.