Codechange: move tick-counter into TimerGameTick (#10712)

This commit is contained in:
Patric Stout
2023-04-24 18:55:40 +02:00
committed by GitHub
parent 7aa2b9ab0a
commit 31ad990831
22 changed files with 60 additions and 51 deletions

View File

@@ -58,6 +58,7 @@
#include "newgrf_roadstop.h"
#include "timer/timer.h"
#include "timer/timer_game_calendar.h"
#include "timer/timer_game_tick.h"
#include "table/strings.h"
@@ -2116,7 +2117,7 @@ void Vehicle::BeginLoading()
{
assert(IsTileType(this->tile, MP_STATION) || this->type == VEH_SHIP);
Ticks travel_time = _tick_counter - this->last_loading_tick;
Ticks travel_time = TimerGameTick::counter - this->last_loading_tick;
if (this->current_order.IsType(OT_GOTO_STATION) &&
this->current_order.GetDestination() == this->last_station_visited) {
this->DeleteUnreachedImplicitOrders();
@@ -2281,7 +2282,7 @@ void Vehicle::LeaveStation()
/* if the vehicle could load here or could stop with cargo loaded set the last loading station */
this->last_loading_station = this->last_station_visited;
this->last_loading_tick = _tick_counter;
this->last_loading_tick = TimerGameTick::counter;
} else {
/* if the vehicle couldn't load and had to unload or transfer everything
* set the last loading station to invalid as it will leave empty. */