Revert: "Codechange: remove parameter which value can always be deduced" (#13183)

This reverts commit dfb74e25f7.
This commit is contained in:
Peter Nelson 2024-12-21 19:49:02 +00:00 committed by GitHub
parent 2c740cf7e7
commit 2176d49a39
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 4 deletions

View File

@ -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();
}

View File

@ -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.