Codechange: Move VehicleEnteredDepotThisTick call to a more suitable position. (#14065)
This commit is contained in:
@@ -925,7 +925,7 @@ Vehicle::~Vehicle()
|
||||
* Adds a vehicle to the list of vehicles that visited a depot this tick
|
||||
* @param *v vehicle to add
|
||||
*/
|
||||
void VehicleEnteredDepotThisTick(Vehicle *v)
|
||||
static void VehicleEnteredDepotThisTick(Vehicle *v)
|
||||
{
|
||||
/* Vehicle should stop in the depot if it was in 'stopping' state */
|
||||
_vehicles_to_autoreplace[v->index] = !v->vehstatus.Test(VehState::Stopped);
|
||||
@@ -1610,6 +1610,9 @@ void VehicleEnterDepot(Vehicle *v)
|
||||
|
||||
VehicleServiceInDepot(v);
|
||||
|
||||
/* Store that the vehicle entered a depot this tick */
|
||||
VehicleEnteredDepotThisTick(v);
|
||||
|
||||
/* After a vehicle trigger, the graphics and properties of the vehicle could change. */
|
||||
TriggerVehicle(v, VEHICLE_TRIGGER_DEPOT);
|
||||
v->MarkDirty();
|
||||
|
||||
Reference in New Issue
Block a user