Fix VRF_BEYOND_PLATFORM_END not being cleared when switching order

This commit is contained in:
Jonathan G Rennison
2022-01-03 12:47:44 +00:00
parent e993afcd99
commit 30817c3915
4 changed files with 21 additions and 0 deletions

View File

@@ -3669,6 +3669,12 @@ CommandCost Vehicle::SendToDepot(DoCommandFlag flags, DepotCommand command, Tile
if (flags & DC_EXEC) {
if (this->current_order.IsAnyLoadingType()) this->LeaveStation();
if (this->type == VEH_TRAIN) {
for (Train *v = Train::From(this); v != nullptr; v = v->Next()) {
ClrBit(v->flags, VRF_BEYOND_PLATFORM_END);
}
}
if (this->IsGroundVehicle() && this->GetNumManualOrders() > 0) {
uint16 &gv_flags = this->GetGroundVehicleFlags();
SetBit(gv_flags, GVF_SUPPRESS_IMPLICIT_ORDERS);