Add release slot train order

This commit is contained in:
Jonathan G Rennison
2021-02-10 22:30:22 +00:00
parent d42ad99688
commit 8a814bbfe3
9 changed files with 128 additions and 6 deletions

View File

@@ -4001,7 +4001,7 @@ static Track ChooseTrainTrack(Train *v, TileIndex tile, DiagDirection enterdir,
* Also check if the current order is a service order so we don't reserve a path to
* the destination but instead to the next one if service isn't needed. */
CheckIfTrainNeedsService(v);
if (v->current_order.IsType(OT_DUMMY) || v->current_order.IsType(OT_CONDITIONAL) || v->current_order.IsType(OT_GOTO_DEPOT)) ProcessOrders(v);
if (v->current_order.IsType(OT_DUMMY) || v->current_order.IsType(OT_CONDITIONAL) || v->current_order.IsType(OT_GOTO_DEPOT) || v->current_order.IsType(OT_RELEASE_SLOT)) ProcessOrders(v);
}
/* Save the current train order. The destructor will restore the old order on function exit. */
@@ -5905,7 +5905,7 @@ static bool TrainLocoHandler(Train *v, bool mode)
/* exit if train is stopped */
if ((v->vehstatus & VS_STOPPED) && v->cur_speed == 0) return true;
bool valid_order = !v->current_order.IsType(OT_NOTHING) && v->current_order.GetType() != OT_CONDITIONAL;
bool valid_order = !v->current_order.IsType(OT_NOTHING) && v->current_order.GetType() != OT_CONDITIONAL && !v->current_order.IsType(OT_RELEASE_SLOT);
if (ProcessOrders(v) && CheckReverseTrain(v)) {
v->wait_counter = 0;
v->cur_speed = 0;