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:
@@ -2023,13 +2023,13 @@ int GetTraceRestrictTimeDateValueFromDate(TraceRestrictTimeDateValueField type,
|
||||
|
||||
case TRTDVF_DAY: {
|
||||
YearMonthDay ymd;
|
||||
ConvertDateToYMD(scaled_date_ticks / (DAY_TICKS * _settings_game.economy.day_length_factor), &ymd);
|
||||
ConvertDateToYMD(ScaledDateTicksToDate(scaled_date_ticks), &ymd);
|
||||
return ymd.day;
|
||||
}
|
||||
|
||||
case TRTDVF_MONTH: {
|
||||
YearMonthDay ymd;
|
||||
ConvertDateToYMD(scaled_date_ticks / (DAY_TICKS * _settings_game.economy.day_length_factor), &ymd);
|
||||
ConvertDateToYMD(ScaledDateTicksToDate(scaled_date_ticks), &ymd);
|
||||
return ymd.month + 1;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user