diff options
author | alberth <alberth@openttd.org> | 2010-07-24 10:14:39 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2010-07-24 10:14:39 +0000 |
commit | be6c0584240caf420b2475a0be036391e842e8af (patch) | |
tree | 6111751cf5526e1eb41176782d84766c4e9ed185 /src/order_cmd.cpp | |
parent | 645b6ce77345867fa96861843197481131566c46 (diff) | |
download | openttd-be6c0584240caf420b2475a0be036391e842e8af.tar.xz |
(svn r20211) -Codechange: Indented code should have curly braces around it.
Diffstat (limited to 'src/order_cmd.cpp')
-rw-r--r-- | src/order_cmd.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp index 25b9162ad..800c4aca9 100644 --- a/src/order_cmd.cpp +++ b/src/order_cmd.cpp @@ -252,9 +252,9 @@ Order *OrderList::GetOrderAt(int index) const Order *order = this->first; - while (order != NULL && index-- > 0) + while (order != NULL && index-- > 0) { order = order->next; - + } return order; } @@ -686,8 +686,9 @@ CommandCost CmdInsertOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 if (sel_ord <= u->cur_order_index) { uint cur = u->cur_order_index + 1; /* Check if we don't go out of bound */ - if (cur < u->GetNumOrders()) + if (cur < u->GetNumOrders()) { u->cur_order_index = cur; + } } /* Update any possible open window of the vehicle */ InvalidateVehicleOrder(u, INVALID_VEH_ORDER_ID | (sel_ord << 8)); @@ -752,8 +753,7 @@ CommandCost CmdDeleteOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 if (ret.Failed()) return ret; /* If we did not select an order, we maybe want to de-clone the orders */ - if (sel_ord >= v->GetNumOrders()) - return DecloneOrder(v, flags); + if (sel_ord >= v->GetNumOrders()) return DecloneOrder(v, flags); order = v->GetOrder(sel_ord); if (order == NULL) return CMD_ERROR; @@ -764,8 +764,7 @@ CommandCost CmdDeleteOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 Vehicle *u = v->FirstShared(); DeleteOrderWarnings(u); for (; u != NULL; u = u->NextShared()) { - if (sel_ord < u->cur_order_index) - u->cur_order_index--; + if (sel_ord < u->cur_order_index) u->cur_order_index--; assert(v->orders.list == u->orders.list); @@ -1480,8 +1479,7 @@ void CheckOrders(const Vehicle *v) if (v->vehstatus & VS_CRASHED) return; /* Do nothing for stopped vehicles if setting is '1' */ - if (_settings_client.gui.order_review_system == 1 && (v->vehstatus & VS_STOPPED)) - return; + if (_settings_client.gui.order_review_system == 1 && (v->vehstatus & VS_STOPPED)) return; /* do nothing we we're not the first vehicle in a share-chain */ if (v->FirstShared() != v) return; @@ -1595,8 +1593,7 @@ bool VehicleHasDepotOrders(const Vehicle *v) const Order *order; FOR_VEHICLE_ORDERS(v, order) { - if (order->IsType(OT_GOTO_DEPOT)) - return true; + if (order->IsType(OT_GOTO_DEPOT)) return true; } return false; |