Clear order wait times when changing to a non-stopping order

This commit is contained in:
Jonathan G Rennison
2022-01-12 19:16:42 +00:00
parent dd312ef9a4
commit 9e1a78c86e
2 changed files with 7 additions and 1 deletions

View File

@@ -1891,6 +1891,9 @@ CommandCost CmdModifyOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
order->SetRefit(CT_NO_REFIT); order->SetRefit(CT_NO_REFIT);
order->SetLoadType(OLF_LOAD_IF_POSSIBLE); order->SetLoadType(OLF_LOAD_IF_POSSIBLE);
order->SetUnloadType(OUF_UNLOAD_IF_POSSIBLE); order->SetUnloadType(OUF_UNLOAD_IF_POSSIBLE);
if (order->IsWaitTimetabled() || order->GetWaitTime() > 0) {
DoCommandEx(tile, v->index | (MTF_WAIT_TIME << 28) | (1 << 31), 0, p3, flags, CMD_CHANGE_TIMETABLE);
}
} }
break; break;

View File

@@ -206,7 +206,10 @@ CommandCost CmdChangeTimetable(TileIndex tile, DoCommandFlag flags, uint32 p1, u
if (wait_time != order->GetWaitTime() || leave_type != order->GetLeaveType()) { if (wait_time != order->GetWaitTime() || leave_type != order->GetLeaveType()) {
switch (order->GetType()) { switch (order->GetType()) {
case OT_GOTO_STATION: case OT_GOTO_STATION:
if (order->GetNonStopType() & ONSF_NO_STOP_AT_DESTINATION_STATION) return_cmd_error(STR_ERROR_TIMETABLE_NOT_STOPPING_HERE); if (order->GetNonStopType() & ONSF_NO_STOP_AT_DESTINATION_STATION) {
if (mtf == MTF_WAIT_TIME && clear_field) break;
return_cmd_error(STR_ERROR_TIMETABLE_NOT_STOPPING_HERE);
}
break; break;
case OT_GOTO_DEPOT: case OT_GOTO_DEPOT: