mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-11 13:10:45 +00:00
(svn r21229) -Fix [FS#4130]: [YAPF] Road vehicles not finding the nearest depot in some (corner) cases
This commit is contained in:
parent
4958bf44d9
commit
3aafe20b58
@ -131,6 +131,18 @@ struct CFollowTrackT
|
|||||||
if (!CanEnterNewTile()) return false;
|
if (!CanEnterNewTile()) return false;
|
||||||
m_new_td_bits &= DiagdirReachesTrackdirs(m_exitdir);
|
m_new_td_bits &= DiagdirReachesTrackdirs(m_exitdir);
|
||||||
if (m_new_td_bits == TRACKDIR_BIT_NONE) {
|
if (m_new_td_bits == TRACKDIR_BIT_NONE) {
|
||||||
|
/* In case we can't enter the next tile, but are
|
||||||
|
* a normal road vehicle, then we can actually
|
||||||
|
* try to reverse as this is the end of the road.
|
||||||
|
* Trams can only turn on the appropriate bits in
|
||||||
|
* which case reaching this would mean a dead end
|
||||||
|
* near a building and in that case there would
|
||||||
|
* a "false" QueryNewTileTrackStatus result and
|
||||||
|
* as such reversing is already tried. The fact
|
||||||
|
* that function failed can have to do with a
|
||||||
|
* missing road bit, or inability to connect the
|
||||||
|
* different bits due to slopes. */
|
||||||
|
if (IsRoadTT() && !IsTram() && TryReverse()) return true;
|
||||||
m_err = EC_NO_WAY;
|
m_err = EC_NO_WAY;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user