From 2176d49a39a7d8908080965b59fdd40df1012a43 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Sat, 21 Dec 2024 19:49:02 +0000 Subject: [PATCH] Revert: "Codechange: remove parameter which value can always be deduced" (#13183) This reverts commit dfb74e25f7ac41c80b3a2d9f4443b3a89d320900. --- src/roadstop.cpp | 8 +++++--- src/roadstop_base.h | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/roadstop.cpp b/src/roadstop.cpp index 68281498e9..7fa254ccfa 100644 --- a/src/roadstop.cpp +++ b/src/roadstop.cpp @@ -360,15 +360,17 @@ static DiagDirection GetEntryDirection(bool east, Axis axis) /** * Rebuild, from scratch, the vehicles and other metadata on this stop. * @param rs the roadstop this entry is part of + * @param side the side of the road stop to look at */ -void RoadStop::Entry::Rebuild(const RoadStop *rs) +void RoadStop::Entry::Rebuild(const RoadStop *rs, int side) { assert(HasBit(rs->status, RSSFB_BASE_ENTRY)); Axis axis = GetDriveThroughStopAxis(rs->xy); + if (side == -1) side = (rs->east == this); RoadStopEntryRebuilderHelper rserh; - rserh.dir = GetEntryDirection(rs->east == this, axis); + rserh.dir = GetEntryDirection(side, axis); this->length = 0; TileIndexDiff offset = TileOffsByAxis(axis); @@ -397,6 +399,6 @@ void RoadStop::Entry::CheckIntegrity(const RoadStop *rs) const assert(!IsDriveThroughRoadStopContinuation(rs->xy, rs->xy - TileOffsByAxis(GetDriveThroughStopAxis(rs->xy)))); Entry temp; - temp.Rebuild(rs); + temp.Rebuild(rs, rs->east == this); if (temp.length != this->length || temp.occupied != this->occupied) NOT_REACHED(); } diff --git a/src/roadstop_base.h b/src/roadstop_base.h index 16ec909420..1c425549c9 100644 --- a/src/roadstop_base.h +++ b/src/roadstop_base.h @@ -62,7 +62,7 @@ struct RoadStop : RoadStopPool::PoolItem<&_roadstop_pool> { void Leave(const RoadVehicle *rv); void Enter(const RoadVehicle *rv); void CheckIntegrity(const RoadStop *rs) const; - void Rebuild(const RoadStop *rs); + void Rebuild(const RoadStop *rs, int side = -1); }; uint8_t status; ///< Current status of the Stop, @see RoadStopSatusFlag. Access using *Bay and *Busy functions.