Change: Make _tick_counter 64bit to avoid wrapping (#10035)

This commit is contained in:
dP
2022-09-21 13:42:29 +03:00
committed by GitHub
parent 164ec3ac07
commit 548f0496a9
12 changed files with 25 additions and 14 deletions

View File

@@ -6313,7 +6313,7 @@ bool GetGlobalVariable(byte param, uint32 *value, const GRFFile *grffile)
return true;
case 0x0A: // animation counter
*value = _tick_counter;
*value = GB(_tick_counter, 0, 16);
return true;
case 0x0B: { // TTDPatch version
@@ -9814,7 +9814,7 @@ void LoadNewGRF(uint load_index, uint num_baseset)
Date date = _date;
Year year = _cur_year;
DateFract date_fract = _date_fract;
uint16 tick_counter = _tick_counter;
uint64 tick_counter = _tick_counter;
byte display_opt = _display_opt;
if (_networking) {