Changing day length or date no longer changes time in minutes

Add offset variables for scaled date ticks.
Adjust offset when changing day length or date, such that scaled
date ticks remain the same.
Store _scaled_tick_counter and scaled date ticks offset in the savagame.
This commit is contained in:
Jonathan G Rennison
2022-12-15 22:54:42 +00:00
parent 9038c849ab
commit 3877bb31ef
18 changed files with 127 additions and 48 deletions

View File

@@ -241,7 +241,7 @@ DepartureList* MakeDepartureList(StationID station, const std::vector<const Vehi
/* The maximum possible date for departures to be scheduled to occur. */
DateTicksScaled max_date = _settings_client.gui.max_departure_time * DAY_TICKS * _settings_game.economy.day_length_factor;
DateTicksScaled date_only_scaled = ((DateTicksScaled)_date * DAY_TICKS * _settings_game.economy.day_length_factor);
DateTicksScaled date_only_scaled = DateToScaledDateTicks(_date);
DateTicksScaled date_fract_scaled = ((DateTicksScaled)_date_fract * _settings_game.economy.day_length_factor) + _tick_skip_counter;
/* The scheduled order in next_orders with the earliest expected_date field. */