From d24a9a9df5502735bf607f2dda3ed99d9d0e7859 Mon Sep 17 00:00:00 2001 From: frosch Date: Sun, 3 Jan 2021 15:05:34 +0100 Subject: Cleanup 8139b14: Move a comment back to the line it belongs to, and add a comment for new code. --- src/engine.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/engine.cpp') diff --git a/src/engine.cpp b/src/engine.cpp index f4737cf59..575995f86 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -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; -- cgit v1.2.3-54-g00ecf