diff options
author | alberth <alberth@openttd.org> | 2009-06-01 11:43:36 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2009-06-01 11:43:36 +0000 |
commit | bab70a823dd810e1d4477f0c01d3a7b3e9b19ac8 (patch) | |
tree | 2668a1043fb310d44e67f4deb07871519d406a55 /src/aircraft_cmd.cpp | |
parent | 5e91bf0ad20e0c60b31e190a1f02f184020238de (diff) | |
download | openttd-bab70a823dd810e1d4477f0c01d3a7b3e9b19ac8.tar.xz |
(svn r16491) -Codechange: Added parentheses around bitwise operators for code style.
Diffstat (limited to 'src/aircraft_cmd.cpp')
-rw-r--r-- | src/aircraft_cmd.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp index 134ca6081..817895f35 100644 --- a/src/aircraft_cmd.cpp +++ b/src/aircraft_cmd.cpp @@ -110,10 +110,9 @@ static StationID FindNearestHangar(const Aircraft *v) const AirportFTAClass *afc = st->Airport(); if (afc->nof_depots == 0 || ( /* don't crash the plane if we know it can't land at the airport */ - afc->flags & AirportFTAClass::SHORT_STRIP && - AircraftVehInfo(v->engine_type)->subtype & AIR_FAST && - !_cheats.no_jetcrash.value - )) { + (afc->flags & AirportFTAClass::SHORT_STRIP) && + (AircraftVehInfo(v->engine_type)->subtype & AIR_FAST) && + !_cheats.no_jetcrash.value)) { continue; } @@ -137,7 +136,7 @@ static bool HaveHangarInOrderList(Aircraft *v) FOR_VEHICLE_ORDERS(v, order) { const Station *st = Station::Get(order->station); - if (st->owner == v->owner && st->facilities & FACIL_AIRPORT) { + if (st->owner == v->owner && (st->facilities & FACIL_AIRPORT)) { /* If an airport doesn't have a hangar, skip it */ if (st->Airport()->nof_depots != 0) return true; @@ -1057,7 +1056,7 @@ static bool AircraftController(Aircraft *v) GetNewVehiclePosResult gp; - if (dist < 4 || amd->flag & AMED_LAND) { + if (dist < 4 || (amd->flag & AMED_LAND)) { /* move vehicle one pixel towards target */ gp.x = (v->x_pos != (x + amd->x)) ? v->x_pos + ((x + amd->x > v->x_pos) ? 1 : -1) : @@ -1334,8 +1333,8 @@ static void MaybeCrashAirplane(Aircraft *v) /* FIXME -- MaybeCrashAirplane -> increase crashing chances of very modern airplanes on smaller than AT_METROPOLITAN airports */ uint16 prob = 0x10000 / 1500; - if (st->Airport()->flags & AirportFTAClass::SHORT_STRIP && - AircraftVehInfo(v->engine_type)->subtype & AIR_FAST && + if ((st->Airport()->flags & AirportFTAClass::SHORT_STRIP) && + (AircraftVehInfo(v->engine_type)->subtype & AIR_FAST) && !_cheats.no_jetcrash.value) { prob = 0x10000 / 20; } @@ -1617,7 +1616,7 @@ static void AircraftEventHandler_Flying(Aircraft *v, const AirportFTAClass *apc) Station *st = Station::Get(v->targetairport); /* runway busy or not allowed to use this airstation, circle */ - if (apc->flags & (v->subtype == AIR_HELICOPTER ? AirportFTAClass::HELICOPTERS : AirportFTAClass::AIRPLANES) && + if ((apc->flags & (v->subtype == AIR_HELICOPTER ? AirportFTAClass::HELICOPTERS : AirportFTAClass::AIRPLANES)) && st->airport_tile != INVALID_TILE && (st->owner == OWNER_NONE || st->owner == v->owner)) { /* {32,FLYING,NOTHING_block,37}, {32,LANDING,N,33}, {32,HELILANDING,N,41}, |