Codechange: Replace station related FOR_ALL with range-based for loops

This commit is contained in:
glx
2019-12-15 05:55:59 +01:00
committed by Niels Martin Hansen
parent 3a14cea068
commit ddabfed1cd
27 changed files with 76 additions and 151 deletions

View File

@@ -119,7 +119,6 @@ enum HelicopterRotorStates {
*/
static StationID FindNearestHangar(const Aircraft *v)
{
const Station *st;
uint best = 0;
StationID index = INVALID_STATION;
TileIndex vtile = TileVirtXY(v->x_pos, v->y_pos);
@@ -140,7 +139,7 @@ static StationID FindNearestHangar(const Aircraft *v)
}
}
FOR_ALL_STATIONS(st) {
for (const Station *st : Station::Iterate()) {
if (st->owner != v->owner || !(st->facilities & FACIL_AIRPORT) || !st->airport.HasHangar()) continue;
const AirportFTAClass *afc = st->airport.GetFTA();