Codechange: Define Date/Year/Month/Day within TimerGameCalendar class

This commit is contained in:
Tyler Trahan
2023-04-24 14:33:18 -04:00
parent 20d2558f1b
commit 930f0a16d8
68 changed files with 216 additions and 182 deletions

View File

@@ -30,6 +30,7 @@
#include "../core/smallvec_type.hpp"
#include "../timer/timer.h"
#include "../timer/timer_game_tick.h"
#include "../timer/timer_game_calendar.h"
#include "saveload_internal.h"
#include "oldloader.h"
#include <array>
@@ -399,7 +400,7 @@ static bool FixTTOEngines()
for (uint i = 0; i < lengthof(_orig_aircraft_vehicle_info); i++, j++) new (GetTempDataEngine(j)) Engine(VEH_AIRCRAFT, i);
}
Date aging_date = std::min(TimerGameCalendar::date + DAYS_TILL_ORIGINAL_BASE_YEAR, ConvertYMDToDate(2050, 0, 1));
TimerGameCalendar::Date aging_date = std::min(TimerGameCalendar::date + DAYS_TILL_ORIGINAL_BASE_YEAR, ConvertYMDToDate(2050, 0, 1));
for (EngineID i = 0; i < 256; i++) {
int oi = ttd_to_tto[i];

View File

@@ -18,6 +18,7 @@
#include "../vehicle_base.h"
#include "../newgrf_station.h"
#include "../newgrf_roadstop.h"
#include "../timer/timer_game_calendar.h"
#include "table/strings.h"
@@ -67,7 +68,7 @@ void MoveBuoysToWaypoints()
Town *town = st->town;
StringID string_id = st->string_id;
std::string name = st->name;
Date build_date = st->build_date;
TimerGameCalendar::Date build_date = st->build_date;
/* TTDPatch could use "buoys with rail station" for rail waypoints */
bool train = st->train_station.tile != INVALID_TILE;
TileArea train_st = st->train_station;

View File

@@ -14,6 +14,7 @@
#include "../vehicle_base.h"
#include "../town.h"
#include "../newgrf.h"
#include "../timer/timer_game_calendar.h"
#include "table/strings.h"
@@ -31,7 +32,7 @@ struct OldWaypoint {
StringID string_id;
std::string name;
uint8 delete_ctr;
Date build_date;
TimerGameCalendar::Date build_date;
uint8 localidx;
uint32 grfid;
const StationSpec *spec;