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/ai | |
parent | 5e91bf0ad20e0c60b31e190a1f02f184020238de (diff) | |
download | openttd-bab70a823dd810e1d4477f0c01d3a7b3e9b19ac8.tar.xz |
(svn r16491) -Codechange: Added parentheses around bitwise operators for code style.
Diffstat (limited to 'src/ai')
-rw-r--r-- | src/ai/api/ai_order.cpp | 18 | ||||
-rw-r--r-- | src/ai/api/ai_town.cpp | 2 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/ai/api/ai_order.cpp b/src/ai/api/ai_order.cpp index ce1e3ed46..be5b33012 100644 --- a/src/ai/api/ai_order.cpp +++ b/src/ai/api/ai_order.cpp @@ -119,18 +119,18 @@ static const Order *ResolveOrder(VehicleID vehicle_id, AIOrder::OrderPosition or { switch (::GetOrderTypeByTile(destination)) { case OT_GOTO_STATION: - return ((order_flags & ~(AIOF_NON_STOP_FLAGS | AIOF_UNLOAD_FLAGS | AIOF_LOAD_FLAGS)) == 0) && + return (order_flags & ~(AIOF_NON_STOP_FLAGS | AIOF_UNLOAD_FLAGS | AIOF_LOAD_FLAGS)) == 0 && /* Test the different mutual exclusive flags. */ - (((order_flags & AIOF_TRANSFER) == 0) || ((order_flags & AIOF_UNLOAD) == 0)) && - (((order_flags & AIOF_TRANSFER) == 0) || ((order_flags & AIOF_NO_UNLOAD) == 0)) && - (((order_flags & AIOF_UNLOAD) == 0) || ((order_flags & AIOF_NO_UNLOAD) == 0)) && - (((order_flags & AIOF_UNLOAD) == 0) || ((order_flags & AIOF_NO_UNLOAD) == 0)) && - (((order_flags & AIOF_NO_UNLOAD) == 0) || ((order_flags & AIOF_NO_LOAD) == 0)) && - (((order_flags & AIOF_FULL_LOAD_ANY) == 0) || ((order_flags & AIOF_NO_LOAD) == 0)); + ((order_flags & AIOF_TRANSFER) == 0 || (order_flags & AIOF_UNLOAD) == 0) && + ((order_flags & AIOF_TRANSFER) == 0 || (order_flags & AIOF_NO_UNLOAD) == 0) && + ((order_flags & AIOF_UNLOAD) == 0 || (order_flags & AIOF_NO_UNLOAD) == 0) && + ((order_flags & AIOF_UNLOAD) == 0 || (order_flags & AIOF_NO_UNLOAD) == 0) && + ((order_flags & AIOF_NO_UNLOAD) == 0 || (order_flags & AIOF_NO_LOAD) == 0) && + ((order_flags & AIOF_FULL_LOAD_ANY) == 0 || (order_flags & AIOF_NO_LOAD) == 0); case OT_GOTO_DEPOT: - return ((order_flags & ~(AIOF_NON_STOP_FLAGS | AIOF_DEPOT_FLAGS)) == 0) && - (((order_flags & AIOF_SERVICE_IF_NEEDED) == 0) || ((order_flags & AIOF_STOP_IN_DEPOT) == 0)); + return (order_flags & ~(AIOF_NON_STOP_FLAGS | AIOF_DEPOT_FLAGS)) == 0 && + ((order_flags & AIOF_SERVICE_IF_NEEDED) == 0 || (order_flags & AIOF_STOP_IN_DEPOT) == 0); case OT_GOTO_WAYPOINT: return (order_flags & ~(AIOF_NON_STOP_FLAGS)) == 0; default: return false; diff --git a/src/ai/api/ai_town.cpp b/src/ai/api/ai_town.cpp index cd75996f9..22e68234c 100644 --- a/src/ai/api/ai_town.cpp +++ b/src/ai/api/ai_town.cpp @@ -183,7 +183,7 @@ int num = 0; const Station *st; FOR_ALL_STATIONS(st) { - if (st->town == t && st->facilities & FACIL_AIRPORT && st->airport_type != AT_OILRIG) num++; + if (st->town == t && (st->facilities & FACIL_AIRPORT) && st->airport_type != AT_OILRIG) num++; } return max(0, 2 - num); } |