diff --git a/src/aircraft.h b/src/aircraft.h index a11383332c..dbf9bfc63c 100644 --- a/src/aircraft.h +++ b/src/aircraft.h @@ -107,7 +107,7 @@ struct Aircraft FINAL : public SpecializedVehicle { } bool Tick() override; - void OnNewDay() override; + void OnNewEconomyDay() override; uint Crash(bool flooded = false) override; TileIndex GetOrderStationLocation(StationID station) override; ClosestDepot FindClosestDepot() override; diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp index 1dc9f22d8f..5ce05b82b1 100644 --- a/src/aircraft_cmd.cpp +++ b/src/aircraft_cmd.cpp @@ -440,7 +440,7 @@ Money Aircraft::GetRunningCost() const return GetPrice(PR_RUNNING_AIRCRAFT, cost_factor, e->GetGRF()); } -void Aircraft::OnNewDay() +void Aircraft::OnNewEconomyDay() { if (!this->IsNormalAircraft()) return; diff --git a/src/roadveh.h b/src/roadveh.h index 90b02ba878..e4cb266919 100644 --- a/src/roadveh.h +++ b/src/roadveh.h @@ -134,7 +134,7 @@ struct RoadVehicle FINAL : public GroundVehicle { int GetDisplayImageWidth(Point *offset = nullptr) const; bool IsInDepot() const override { return this->state == RVSB_IN_DEPOT; } bool Tick() override; - void OnNewDay() override; + void OnNewEconomyDay() override; uint Crash(bool flooded = false) override; Trackdir GetVehicleTrackdir() const override; TileIndex GetOrderStationLocation(StationID station) override; diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp index b66a7bab4f..0998849bce 100644 --- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -1706,7 +1706,7 @@ static void CheckIfRoadVehNeedsService(RoadVehicle *v) SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, WID_VV_START_STOP); } -void RoadVehicle::OnNewDay() +void RoadVehicle::OnNewEconomyDay() { AgeVehicle(this); diff --git a/src/ship.h b/src/ship.h index 7c8fcc89a9..85e3ee64ca 100644 --- a/src/ship.h +++ b/src/ship.h @@ -45,7 +45,7 @@ struct Ship FINAL : public SpecializedVehicle { Money GetRunningCost() const override; bool IsInDepot() const override { return this->state == TRACK_BIT_DEPOT; } bool Tick() override; - void OnNewDay() override; + void OnNewEconomyDay() override; Trackdir GetVehicleTrackdir() const override; TileIndex GetOrderStationLocation(StationID station) override; ClosestDepot FindClosestDepot() override; diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp index a77b96fa6a..fc5299f995 100644 --- a/src/ship_cmd.cpp +++ b/src/ship_cmd.cpp @@ -223,7 +223,7 @@ Money Ship::GetRunningCost() const return GetPrice(PR_RUNNING_SHIP, cost_factor, e->GetGRF()); } -void Ship::OnNewDay() +void Ship::OnNewEconomyDay() { if ((++this->day_counter & 7) == 0) { DecreaseVehicleValue(this); diff --git a/src/train.h b/src/train.h index 460a1cd365..f6209d7b19 100644 --- a/src/train.h +++ b/src/train.h @@ -123,7 +123,7 @@ struct Train FINAL : public GroundVehicle { int GetDisplayImageWidth(Point *offset = nullptr) const; bool IsInDepot() const override { return this->track == TRACK_BIT_DEPOT; } bool Tick() override; - void OnNewDay() override; + void OnNewEconomyDay() override; uint Crash(bool flooded = false) override; Trackdir GetVehicleTrackdir() const override; TileIndex GetOrderStationLocation(StationID station) override; diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index efba47301c..73c66fadd9 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -4165,7 +4165,7 @@ static void CheckIfTrainNeedsService(Train *v) } /** Update day counters of the train vehicle. */ -void Train::OnNewDay() +void Train::OnNewEconomyDay() { AgeVehicle(this); diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 25643447bf..16cabda120 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -918,15 +918,15 @@ void VehicleEnteredDepotThisTick(Vehicle *v) /** * Increases the day counter for all vehicles and calls 1-day and 32-day handlers. - * Each tick, it processes vehicles with "index % DAY_TICKS == TimerGameCalendar::date_fract", + * Each tick, it processes vehicles with "index % DAY_TICKS == TimerGameEconomy::date_fract", * so each day, all vehicles are processes in DAY_TICKS steps. */ -static void RunVehicleDayProc() +static void RunEconomyVehicleDayProc() { if (_game_mode != GM_NORMAL) return; - /* Run the day_proc for every DAY_TICKS vehicle starting at TimerGameCalendar::date_fract. */ - for (size_t i = TimerGameCalendar::date_fract; i < Vehicle::GetPoolSize(); i += Ticks::DAY_TICKS) { + /* Run the economy day proc for every DAY_TICKS vehicle starting at TimerGameEconomy::date_fract. */ + for (size_t i = TimerGameEconomy::date_fract; i < Vehicle::GetPoolSize(); i += Ticks::DAY_TICKS) { Vehicle *v = Vehicle::Get(i); if (v == nullptr) continue; @@ -947,7 +947,7 @@ static void RunVehicleDayProc() } /* This is called once per day for each vehicle, but not in the first tick of the day */ - v->OnNewDay(); + v->OnNewEconomyDay(); } } @@ -955,7 +955,7 @@ void CallVehicleTicks() { _vehicles_to_autoreplace.clear(); - RunVehicleDayProc(); + RunEconomyVehicleDayProc(); { PerformanceMeasurer framerate(PFE_GL_ECONOMY); diff --git a/src/vehicle_base.h b/src/vehicle_base.h index e404901abe..60056bf418 100644 --- a/src/vehicle_base.h +++ b/src/vehicle_base.h @@ -567,9 +567,9 @@ public: virtual bool Tick() { return true; }; /** - * Calls the new day handler of the vehicle + * Calls the new economy day handler of the vehicle */ - virtual void OnNewDay() {}; + virtual void OnNewEconomyDay() {}; void ShiftDates(TimerGameEconomy::Date interval);