1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-17 17:32:45 +01:00

Codechange: Use EnumBitSet for AirportFTAClass::Flags (#13535)

This commit is contained in:
Peter Nelson
2025-02-11 21:49:18 +00:00
committed by GitHub
parent 9cdf740097
commit 0d5708ba86
6 changed files with 14 additions and 16 deletions

View File

@@ -149,10 +149,10 @@ static StationID FindNearestHangar(const Aircraft *v)
const AirportFTAClass *afc = st->airport.GetFTA();
/* don't crash the plane if we know it can't land at the airport */
if ((afc->flags & AirportFTAClass::SHORT_STRIP) && (avi->subtype & AIR_FAST) && !_cheats.no_jetcrash.value) continue;
if (afc->flags.Test(AirportFTAClass::Flag::ShortStrip) && (avi->subtype & AIR_FAST) && !_cheats.no_jetcrash.value) continue;
/* the plane won't land at any helicopter station */
if (!(afc->flags & AirportFTAClass::AIRPLANES) && (avi->subtype & AIR_CTOL)) continue;
if (!afc->flags.Test(AirportFTAClass::Flag::Airplanes) && (avi->subtype & AIR_CTOL)) continue;
/* Check if our last and next destinations can be reached from the depot airport. */
if (max_range != 0) {
@@ -1373,7 +1373,7 @@ static void MaybeCrashAirplane(Aircraft *v)
Station *st = Station::Get(v->targetairport);
uint32_t prob;
if ((st->airport.GetFTA()->flags & AirportFTAClass::SHORT_STRIP) &&
if (st->airport.GetFTA()->flags.Test(AirportFTAClass::Flag::ShortStrip) &&
(AircraftVehInfo(v->engine_type)->subtype & AIR_FAST) &&
!_cheats.no_jetcrash.value) {
prob = 3276;