diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp index 42c1d17674..8e1f36f0e5 100644 --- a/src/aircraft_cmd.cpp +++ b/src/aircraft_cmd.cpp @@ -2152,7 +2152,7 @@ bool Aircraft::Tick() this->tick_counter++; - if (!(this->vehstatus & VS_STOPPED)) this->running_ticks++; + if (!((this->vehstatus & VS_STOPPED) || this->IsWaitingInDepot())) this->running_ticks++; if (this->subtype == AIR_HELICOPTER) HelicopterTickHandler(this); diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp index e42664a4f6..41c0fbbb6b 100644 --- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -2119,7 +2119,7 @@ bool RoadVehicle::Tick() UpdateStateChecksum((((uint64) this->x_pos) << 32) | this->y_pos); UpdateStateChecksum((((uint64) this->state) << 32) | this->frame); if (this->IsFrontEngine()) { - if (!(this->IsRoadVehicleStopped())) this->running_ticks++; + if (!(this->IsRoadVehicleStopped() || this->IsWaitingInDepot())) this->running_ticks++; return RoadVehController(this); } diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp index 3e0fe08793..c3c8a06522 100644 --- a/src/ship_cmd.cpp +++ b/src/ship_cmd.cpp @@ -972,7 +972,7 @@ reverse_direction: bool Ship::Tick() { UpdateStateChecksum((((uint64) this->x_pos) << 32) | this->y_pos); - if (!(this->vehstatus & VS_STOPPED)) this->running_ticks++; + if (!((this->vehstatus & VS_STOPPED) || this->IsWaitingInDepot())) this->running_ticks++; ShipController(this); diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 81d015f2be..c65bb1ffee 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -5162,7 +5162,7 @@ bool Train::Tick() { UpdateStateChecksum((((uint64) this->x_pos) << 32) | (this->y_pos << 16) | this->track ); if (this->IsFrontEngine()) { - if (!(this->vehstatus & VS_STOPPED) || this->cur_speed > 0) this->running_ticks++; + if (!((this->vehstatus & VS_STOPPED) || this->IsWaitingInDepot()) || this->cur_speed > 0) this->running_ticks++; this->current_order_time++; diff --git a/src/vehicle_base.h b/src/vehicle_base.h index 56a4bdbb2a..56b0b47241 100644 --- a/src/vehicle_base.h +++ b/src/vehicle_base.h @@ -584,6 +584,11 @@ public: return this->IsChainInDepot(); } + bool IsWaitingInDepot() const { + assert(this == this->First()); + return this->current_order.IsType(OT_WAITING) && this->IsChainInDepot(); + } + /** * Calls the tick handler of the vehicle * @return is this vehicle still valid?