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

@@ -37,6 +37,7 @@
#include "order_cmd.h"
#include "vehiclelist.h"
#include "tracerestrict.h"
#include "train.h"
#include "table/strings.h"
@@ -1462,6 +1463,12 @@ CommandCost CmdSkipToOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
if (v->current_order.IsAnyLoadingType()) v->LeaveStation();
if (v->current_order.IsType(OT_WAITING)) v->HandleWaiting(true);
if (v->type == VEH_TRAIN) {
for (Train *u = Train::From(v); u != nullptr; u = u->Next()) {
ClrBit(u->flags, VRF_BEYOND_PLATFORM_END);
}
}
v->cur_implicit_order_index = v->cur_real_order_index = sel_ord;
v->UpdateRealOrderIndex();
v->cur_timetable_order_index = INVALID_VEH_ORDER_ID;