Fix #14631, Fix 1cb0cbcb6c: Waypoint customs spec not allocated properly on initial construction. (#14633)

Split AllocateSpecToStation/RoadStop into Allocate and Assign functions, allowing command tests to occur separately.
This commit is contained in:
Peter Nelson
2025-09-21 09:32:25 +01:00
committed by GitHub
parent 030bbc6399
commit 70d4182850
7 changed files with 65 additions and 36 deletions
+2 -1
View File
@@ -136,7 +136,8 @@ void MoveWaypointsToBaseStations()
SetRailStationReservation(tile, reserved);
if (wp.spec != nullptr) {
auto specindex = AllocateSpecToStation(wp.spec, new_wp, true);
auto specindex = AllocateSpecToStation(wp.spec, new_wp);
if (specindex.has_value()) AssignSpecToStation(wp.spec, new_wp, *specindex);
SetCustomStationSpecIndex(tile, specindex.value_or(0));
}
new_wp->rect.BeforeAddTile(tile, StationRect::ADD_FORCE);