mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-10-31 15:20:10 +00:00
Add getter for calendar sub date fract
This commit is contained in:
parent
f32eef4f38
commit
24cd52616c
@ -575,7 +575,7 @@ char *CrashLog::FillCrashLog(char *buffer, const char *last)
|
|||||||
buffer += UTCTime::Format(buffer, last, "Crash at: %Y-%m-%d %H:%M:%S (UTC)\n");
|
buffer += UTCTime::Format(buffer, last, "Crash at: %Y-%m-%d %H:%M:%S (UTC)\n");
|
||||||
|
|
||||||
buffer += seprintf(buffer, last, "In game date: %i-%02i-%02i (%i, %i) (DL: %u)\n", EconTime::CurYear().base(), EconTime::CurMonth() + 1, EconTime::CurDay(), EconTime::CurDateFract(), TickSkipCounter(), DayLengthFactor());
|
buffer += seprintf(buffer, last, "In game date: %i-%02i-%02i (%i, %i) (DL: %u)\n", EconTime::CurYear().base(), EconTime::CurMonth() + 1, EconTime::CurDay(), EconTime::CurDateFract(), TickSkipCounter(), DayLengthFactor());
|
||||||
buffer += seprintf(buffer, last, "Calendar date: %i-%02i-%02i (%i, %i)\n", CalTime::CurYear().base(), CalTime::CurMonth() + 1, CalTime::CurDay(), CalTime::CurDateFract(), CalTime::Detail::now.sub_date_fract);
|
buffer += seprintf(buffer, last, "Calendar date: %i-%02i-%02i (%i, %i)\n", CalTime::CurYear().base(), CalTime::CurMonth() + 1, CalTime::CurDay(), CalTime::CurDateFract(), CalTime::CurSubDateFract());
|
||||||
LogGameLoadDateTimes(buffer, last);
|
LogGameLoadDateTimes(buffer, last);
|
||||||
return buffer;
|
return buffer;
|
||||||
});
|
});
|
||||||
@ -675,7 +675,7 @@ static char *LogDesyncDateHeader(char *buffer, const char *last)
|
|||||||
|
|
||||||
buffer += seprintf(buffer, last, "In game date: %i-%02i-%02i (%i, %i) (DL: %u), %08X\n",
|
buffer += seprintf(buffer, last, "In game date: %i-%02i-%02i (%i, %i) (DL: %u), %08X\n",
|
||||||
EconTime::CurYear().base(), EconTime::CurMonth() + 1, EconTime::CurDay(), EconTime::CurDateFract(), TickSkipCounter(), DayLengthFactor(), _frame_counter);
|
EconTime::CurYear().base(), EconTime::CurMonth() + 1, EconTime::CurDay(), EconTime::CurDateFract(), TickSkipCounter(), DayLengthFactor(), _frame_counter);
|
||||||
buffer += seprintf(buffer, last, "Calendar date: %i-%02i-%02i (%i, %i)\n", CalTime::CurYear().base(), CalTime::CurMonth() + 1, CalTime::CurDay(), CalTime::CurDateFract(), CalTime::Detail::now.sub_date_fract);
|
buffer += seprintf(buffer, last, "Calendar date: %i-%02i-%02i (%i, %i)\n", CalTime::CurYear().base(), CalTime::CurMonth() + 1, CalTime::CurDay(), CalTime::CurDateFract(), CalTime::CurSubDateFract());
|
||||||
LogGameLoadDateTimes(buffer, last);
|
LogGameLoadDateTimes(buffer, last);
|
||||||
if (_networking && !_network_server) {
|
if (_networking && !_network_server) {
|
||||||
extern EconTime::Date _last_sync_date;
|
extern EconTime::Date _last_sync_date;
|
||||||
|
@ -186,6 +186,7 @@ struct CalTime : public DateDetail::BaseTime<struct CalendarTimeTag> {
|
|||||||
static inline Day CurDay() { return Detail::now.cal_ymd.day; }
|
static inline Day CurDay() { return Detail::now.cal_ymd.day; }
|
||||||
static inline Date CurDate() { return Detail::now.cal_date; }
|
static inline Date CurDate() { return Detail::now.cal_date; }
|
||||||
static inline DateFract CurDateFract() { return Detail::now.cal_date_fract; }
|
static inline DateFract CurDateFract() { return Detail::now.cal_date_fract; }
|
||||||
|
static inline uint16_t CurSubDateFract() { return Detail::now.sub_date_fract; }
|
||||||
|
|
||||||
static YearMonthDay ConvertDateToYMD(Date date);
|
static YearMonthDay ConvertDateToYMD(Date date);
|
||||||
static Date ConvertYMDToDate(Year year, Month month, Day day);
|
static Date ConvertYMDToDate(Year year, Month month, Day day);
|
||||||
|
@ -1568,7 +1568,7 @@ void CallVehicleTicks()
|
|||||||
|
|
||||||
if (TickSkipCounter() == 0) RunVehicleDayProc();
|
if (TickSkipCounter() == 0) RunVehicleDayProc();
|
||||||
|
|
||||||
if (EconTime::UsingWallclockUnits() && !CalTime::IsCalendarFrozen() && CalTime::Detail::now.sub_date_fract == 0) {
|
if (EconTime::UsingWallclockUnits() && !CalTime::IsCalendarFrozen() && CalTime::CurSubDateFract() == 0) {
|
||||||
RunVehicleCalendarDayProc();
|
RunVehicleCalendarDayProc();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user