1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-23 20:24:12 +01:00

Codechange: Use single vector for next station order.

Pass vector to insert into to avoid handling multiple vectors.

This may change the order of returned stations.
This commit is contained in:
Peter Nelson
2025-10-16 21:54:43 +01:00
committed by Peter Nelson
parent fd32d1447e
commit d6eff806f0
5 changed files with 17 additions and 14 deletions

View File

@@ -135,7 +135,8 @@ static StationID FindNearestHangar(const Aircraft *v)
next_dest = Station::GetIfValid(v->current_order.GetDestination().ToStationID());
} else {
last_dest = GetTargetAirportIfValid(v);
std::vector<StationID> next_station = v->GetNextStoppingStation();
std::vector<StationID> next_station;
v->GetNextStoppingStation(next_station);
if (!next_station.empty()) next_dest = Station::GetIfValid(next_station.back());
}
}