mirror of https://github.com/OpenTTD/OpenTTD
Codechange: fix vehicle intro date logic
parent
5d061bf1f6
commit
703e9ac8ea
|
@ -737,8 +737,9 @@ void StartupOneEngine(Engine *e, const TimerGameCalendar::YearMonthDay &aging_ym
|
||||||
/* Don't randomise the start-date in the first two years after gamestart to ensure availability
|
/* Don't randomise the start-date in the first two years after gamestart to ensure availability
|
||||||
* of engines in early starting games.
|
* of engines in early starting games.
|
||||||
* Note: TTDP uses fixed 1922 */
|
* Note: TTDP uses fixed 1922 */
|
||||||
if (_settings_game.vehicle.vehicle_intro_randomisation) {
|
TimerGameCalendar::Date begin_random_date = TimerGameCalendar::ConvertYMDToDate(_settings_game.game_creation.starting_year + 2, 0, 1);
|
||||||
e->intro_date = ei->base_intro <= TimerGameCalendar::ConvertYMDToDate(_settings_game.game_creation.starting_year + 2, 0, 1) ? ei->base_intro : (TimerGameCalendar::Date)GB(r, 0, 9) + ei->base_intro;
|
if (_settings_game.vehicle.vehicle_intro_randomisation && ei->base_intro > begin_random_date) {
|
||||||
|
e->intro_date = static_cast<TimerGameCalendar::Date>(GB(r, 0, 9)) + ei->base_intro;
|
||||||
} else {
|
} else {
|
||||||
e->intro_date = ei->base_intro;
|
e->intro_date = ei->base_intro;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue