Debug: De-duplicate formatting of hex dates for desync/random logging

This commit is contained in:
Jonathan G Rennison
2023-12-19 17:55:57 +00:00
parent 61d65c9861
commit 4689113553
11 changed files with 39 additions and 24 deletions

View File

@@ -368,3 +368,9 @@ void IncreaseDate()
/* yes, call various yearly loops */
if (new_year) OnNewYear();
}
const char *debug_date_dumper::HexDate(Date date, DateFract date_fract, uint8 tick_skip_counter)
{
seprintf(this->buffer, lastof(this->buffer), "date{%08x; %02x; %02x}", date.base(), date_fract, tick_skip_counter);
return this->buffer;
}