Codechange: Move VehicleEnteredDepotThisTick call to a more suitable position. (#14065)

This commit is contained in:
frosch
2025-04-21 17:52:03 +02:00
committed by GitHub
parent 7d03cee512
commit 98445088b1
3 changed files with 4 additions and 7 deletions

View File

@@ -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();