Revert "Try something"

This reverts commit 475a097f36a70383d50ee68dac38b5ce087a1eb1.
This commit is contained in:
Andreas Schmitt
2021-06-18 06:34:04 +02:00
parent 02278f7a6f
commit 5d20b9397c

View File

@@ -987,6 +987,7 @@ int Train::GetAtcMaxSpeed(int current_max_speed) const
HasReservedTracks(ft.m_new_tile, TrackdirBitsToTrackBits(ft.m_new_td_bits))) { ///< Tile is reserved
Train* other_train = GetTrainForReservation(ft.m_new_tile, TrackBitsToTrack(TrackdirBitsToTrackBits(ft.m_new_td_bits)));
if (other_train != nullptr &&
other_train != this && ///< Other train is not this train
other_train->GetAccelerationStatus() != AS_BRAKE) { ///< Other train is not braking
@@ -1004,12 +1005,8 @@ int Train::GetAtcMaxSpeed(int current_max_speed) const
old_td = FindFirstTrackdir(reserved);
}
else if (KillFirstBit(ft.m_new_td_bits) != TRACKDIR_BIT_NONE) {
bool path_found = false;
old_td = TrackToTrackdir(YapfTrainChooseTrack(this, ft.m_new_tile, ft.m_exitdir, TrackdirBitsToTrackBits(ft.m_new_td_bits), path_found, false, nullptr));
if(!path_found || old_td == INVALID_TRACKDIR) {
// Tile has more than one track and we have no path. Bail out.
break;
}
// Tile has more than one track and we have no reservation. Bail out.
break;
}
else {
// There was no reservation but there is only one direction to follow, so follow it.