comparison src/economy.cpp @ 12082:d092f17a921d draft

(svn r16491) -Codechange: Added parentheses around bitwise operators for code style.
author alberth <alberth@openttd.org>
date Mon, 01 Jun 2009 11:43:36 +0000
parents da0c682ff327
children f020ec6be498
comparison
equal deleted inserted replaced
12081:f617f25c0cc1 12082:d092f17a921d
1123 static SmallIndustryList industry_set; 1123 static SmallIndustryList industry_set;
1124 industry_set.Clear(); 1124 industry_set.Clear();
1125 1125
1126 for (Vehicle *v = front_v; v != NULL; v = v->Next()) { 1126 for (Vehicle *v = front_v; v != NULL; v = v->Next()) {
1127 /* No cargo to unload */ 1127 /* No cargo to unload */
1128 if (v->cargo_cap == 0 || v->cargo.Empty() || front_v->current_order.GetUnloadType() & OUFB_NO_UNLOAD) continue; 1128 if (v->cargo_cap == 0 || v->cargo.Empty() || (front_v->current_order.GetUnloadType() & OUFB_NO_UNLOAD)) continue;
1129 1129
1130 /* All cargo has already been paid for, no need to pay again */ 1130 /* All cargo has already been paid for, no need to pay again */
1131 if (!v->cargo.UnpaidCargo()) { 1131 if (!v->cargo.UnpaidCargo()) {
1132 SetBit(v->vehicle_flags, VF_CARGO_UNLOADING); 1132 SetBit(v->vehicle_flags, VF_CARGO_UNLOADING);
1133 continue; 1133 continue;
1278 /* The !accepted || v->cargo.Count == cargo_count clause is there 1278 /* The !accepted || v->cargo.Count == cargo_count clause is there
1279 * to make it possible to force unload vehicles at the station where 1279 * to make it possible to force unload vehicles at the station where
1280 * they were loaded, but to not force unload the vehicle when the 1280 * they were loaded, but to not force unload the vehicle when the
1281 * station is still accepting the cargo in the vehicle. It doesn't 1281 * station is still accepting the cargo in the vehicle. It doesn't
1282 * accept cargo that was loaded at the same station. */ 1282 * accept cargo that was loaded at the same station. */
1283 if (u->current_order.GetUnloadType() & (OUFB_UNLOAD | OUFB_TRANSFER) && (!accepted || v->cargo.Count() == cargo_count)) { 1283 if ((u->current_order.GetUnloadType() & (OUFB_UNLOAD | OUFB_TRANSFER)) && (!accepted || v->cargo.Count() == cargo_count)) {
1284 remaining = v->cargo.MoveTo(&ge->cargo, amount_unloaded); 1284 remaining = v->cargo.MoveTo(&ge->cargo, amount_unloaded);
1285 SetBit(ge->acceptance_pickup, GoodsEntry::PICKUP); 1285 SetBit(ge->acceptance_pickup, GoodsEntry::PICKUP);
1286 1286
1287 result |= 2; 1287 result |= 2;
1288 } else if (!accepted) { 1288 } else if (!accepted) {