Codechange: move all date-related variables inside the timer (#10706)

This commit is contained in:
Patric Stout
2023-04-24 17:56:01 +02:00
committed by GitHub
parent f5f6306af3
commit 7aa2b9ab0a
76 changed files with 308 additions and 301 deletions

View File

@@ -17,6 +17,7 @@
#include "newgrf_sound.h"
#include "object_base.h"
#include "object_map.h"
#include "timer/timer_game_calendar.h"
#include "tile_cmd.h"
#include "town.h"
#include "water.h"
@@ -82,7 +83,7 @@ bool ObjectSpec::IsEverAvailable() const
*/
bool ObjectSpec::WasEverAvailable() const
{
return this->IsEverAvailable() && _date > this->introduction_date;
return this->IsEverAvailable() && TimerGameCalendar::date > this->introduction_date;
}
/**
@@ -92,7 +93,7 @@ bool ObjectSpec::WasEverAvailable() const
bool ObjectSpec::IsAvailable() const
{
return this->WasEverAvailable() &&
(_date < this->end_of_life_date || this->end_of_life_date < this->introduction_date + 365);
(TimerGameCalendar::date < this->end_of_life_date || this->end_of_life_date < this->introduction_date + 365);
}
/**
@@ -276,7 +277,7 @@ static uint32 GetCountAndDistanceOfClosestInstance(byte local_id, uint32 grfid,
break;
/* Construction date */
case 0x42: return _date;
case 0x42: return TimerGameCalendar::date;
/* Object founder information */
case 0x44: return _current_company;