Codechange: split GetRoadDir as bays have DiagDir and drive throughs have Axis

This commit is contained in:
Rubidium
2024-10-22 23:25:07 +02:00
committed by rubidium42
parent d6aa09f96a
commit c9819f8957
11 changed files with 100 additions and 56 deletions

View File

@@ -250,7 +250,7 @@ protected:
{
/* road stop can be left at one direction only unless it's a drive-through stop */
if (IsRoadTT() && IsBayRoadStopTile(m_old_tile)) {
DiagDirection exitdir = GetRoadStopDir(m_old_tile);
DiagDirection exitdir = GetBayRoadStopDir(m_old_tile);
if (exitdir != m_exitdir) {
m_err = EC_NO_WAY;
return false;
@@ -282,7 +282,7 @@ protected:
{
if (IsRoadTT() && IsBayRoadStopTile(m_new_tile)) {
/* road stop can be entered from one direction only unless it's a drive-through stop */
DiagDirection exitdir = GetRoadStopDir(m_new_tile);
DiagDirection exitdir = GetBayRoadStopDir(m_new_tile);
if (ReverseDiagDir(exitdir) != m_exitdir) {
m_err = EC_NO_WAY;
return false;
@@ -404,7 +404,7 @@ protected:
/* Single tram bits and standard road stops cause reversing. */
if (IsRoadTT() && ((IsTram() && GetSingleTramBit(m_old_tile) == ReverseDiagDir(m_exitdir)) ||
(IsBayRoadStopTile(m_old_tile) && GetRoadStopDir(m_old_tile) == ReverseDiagDir(m_exitdir)))) {
(IsBayRoadStopTile(m_old_tile) && GetBayRoadStopDir(m_old_tile) == ReverseDiagDir(m_exitdir)))) {
/* reverse */
m_new_tile = m_old_tile;
m_new_td_bits = TrackdirToTrackdirBits(ReverseTrackdir(m_old_td));