Cleanup 8139b14: Move a comment back to the line it belongs to, and add a comment for new code.

This commit is contained in:
frosch 2021-01-03 15:05:34 +01:00 committed by Charles Pigott
parent 21a45168bd
commit d24a9a9df5
1 changed files with 5 additions and 3 deletions

View File

@ -643,9 +643,8 @@ void StartupOneEngine(Engine *e, Date aging_date)
e->company_avail = 0;
e->company_hidden = 0;
/* Don't randomise the start-date in the first two years after gamestart to ensure availability
* of engines in early starting games.
* Note: TTDP uses fixed 1922 */
/* Vehicles with the same base_intro date shall be introduced at the same time.
* Make sure they use the same randomisation of the date. */
SavedRandomSeeds saved_seeds;
SaveRandomSeeds(&saved_seeds);
SetRandomSeed(_settings_game.game_creation.generation_seed ^
@ -654,6 +653,9 @@ void StartupOneEngine(Engine *e, Date aging_date)
e->GetGRFID());
uint32 r = Random();
/* Don't randomise the start-date in the first two years after gamestart to ensure availability
* of engines in early starting games.
* Note: TTDP uses fixed 1922 */
e->intro_date = ei->base_intro <= ConvertYMDToDate(_settings_game.game_creation.starting_year + 2, 0, 1) ? ei->base_intro : (Date)GB(r, 0, 9) + ei->base_intro;
if (e->intro_date <= _date) {
e->age = (aging_date - e->intro_date) >> 5;