Codechange: Standardise how AllocateSpecToStation/RoadStop are called. (#14525)

Replace use of negative value with std::optional and update doxygen.
This commit is contained in:
Peter Nelson
2025-08-19 18:52:36 +01:00
committed by GitHub
parent 5eeede82c5
commit 1cb0cbcb6c
7 changed files with 39 additions and 32 deletions
+2 -1
View File
@@ -136,7 +136,8 @@ void MoveWaypointsToBaseStations()
SetRailStationReservation(tile, reserved);
if (wp.spec != nullptr) {
SetCustomStationSpecIndex(tile, AllocateSpecToStation(wp.spec, new_wp, true));
auto specindex = AllocateSpecToStation(wp.spec, new_wp, true);
SetCustomStationSpecIndex(tile, specindex.value_or(0));
}
new_wp->rect.BeforeAddTile(tile, StationRect::ADD_FORCE);