summaryrefslogtreecommitdiff
path: root/src/order_gui.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2009-05-02 00:10:24 +0000
committerfrosch <frosch@openttd.org>2009-05-02 00:10:24 +0000
commitd518b3d0acf38509813daa0614559d267f196154 (patch)
treeb63f38d5da1c67e9a037b28ffdc0f043387b33e5 /src/order_gui.cpp
parenta22ff74ef205dc3409c7e743d24892960cdbb0b1 (diff)
downloadopenttd-d518b3d0acf38509813daa0614559d267f196154.tar.xz
(svn r16199) -Codechange: Pass OrderNonStopFlags also to MakeGoToDepotOrder().
-Fix: 'Go non-stop to nearest depot'-orders did not work wrt. the 'non-stop' part. -Fix: Adding 'Go to nearest depot'-orders did not respect the default setting for 'non-stop'.
Diffstat (limited to 'src/order_gui.cpp')
-rw-r--r--src/order_gui.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/order_gui.cpp b/src/order_gui.cpp
index d9d54547e..fd925f838 100644
--- a/src/order_gui.cpp
+++ b/src/order_gui.cpp
@@ -299,9 +299,9 @@ static Order GetOrderCmdFromTile(const Vehicle *v, TileIndex tile)
case MP_RAILWAY:
if (v->type == VEH_TRAIN && IsTileOwner(tile, _local_company)) {
if (IsRailDepot(tile)) {
- order.MakeGoToDepot(GetDepotByTile(tile)->index, ODTFB_PART_OF_ORDERS);
+ order.MakeGoToDepot(GetDepotByTile(tile)->index, ODTFB_PART_OF_ORDERS,
+ _settings_client.gui.new_nonstop ? ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS : ONSF_STOP_EVERYWHERE);
if (_ctrl_pressed) order.SetDepotOrderType((OrderDepotTypeFlags)(order.GetDepotOrderType() ^ ODTFB_SERVICE));
- if (_settings_client.gui.new_nonstop) order.SetNonStopType(ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS);
return order;
}
}
@@ -309,9 +309,9 @@ static Order GetOrderCmdFromTile(const Vehicle *v, TileIndex tile)
case MP_ROAD:
if (IsRoadDepot(tile) && v->type == VEH_ROAD && IsTileOwner(tile, _local_company)) {
- order.MakeGoToDepot(GetDepotByTile(tile)->index, ODTFB_PART_OF_ORDERS);
+ order.MakeGoToDepot(GetDepotByTile(tile)->index, ODTFB_PART_OF_ORDERS,
+ _settings_client.gui.new_nonstop ? ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS : ONSF_STOP_EVERYWHERE);
if (_ctrl_pressed) order.SetDepotOrderType((OrderDepotTypeFlags)(order.GetDepotOrderType() ^ ODTFB_SERVICE));
- if (_settings_client.gui.new_nonstop) order.SetNonStopType(ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS);
return order;
}
break;
@@ -319,7 +319,7 @@ static Order GetOrderCmdFromTile(const Vehicle *v, TileIndex tile)
case MP_STATION:
if (v->type != VEH_AIRCRAFT) break;
if (IsHangar(tile) && IsTileOwner(tile, _local_company)) {
- order.MakeGoToDepot(GetStationIndex(tile), ODTFB_PART_OF_ORDERS);
+ order.MakeGoToDepot(GetStationIndex(tile), ODTFB_PART_OF_ORDERS, ONSF_STOP_EVERYWHERE);
if (_ctrl_pressed) order.SetDepotOrderType((OrderDepotTypeFlags)(order.GetDepotOrderType() ^ ODTFB_SERVICE));
return order;
}
@@ -330,7 +330,7 @@ static Order GetOrderCmdFromTile(const Vehicle *v, TileIndex tile)
if (IsShipDepot(tile) && IsTileOwner(tile, _local_company)) {
TileIndex tile2 = GetOtherShipDepotTile(tile);
- order.MakeGoToDepot(GetDepotByTile(tile < tile2 ? tile : tile2)->index, ODTFB_PART_OF_ORDERS);
+ order.MakeGoToDepot(GetDepotByTile(tile < tile2 ? tile : tile2)->index, ODTFB_PART_OF_ORDERS, ONSF_STOP_EVERYWHERE);
if (_ctrl_pressed) order.SetDepotOrderType((OrderDepotTypeFlags)(order.GetDepotOrderType() ^ ODTFB_SERVICE));
return order;
}
@@ -507,7 +507,8 @@ private:
Order order;
order.next = NULL;
order.index = 0;
- order.MakeGoToDepot(0, ODTFB_PART_OF_ORDERS);
+ order.MakeGoToDepot(0, ODTFB_PART_OF_ORDERS,
+ _settings_client.gui.new_nonstop && (w->vehicle->type == VEH_TRAIN || w->vehicle->type == VEH_ROAD) ? ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS : ONSF_STOP_EVERYWHERE);
order.SetDepotActionType(ODATFB_NEAREST_DEPOT);
DoCommandP(w->vehicle->tile, w->vehicle->index + (w->OrderGetSel() << 16), order.Pack(), CMD_INSERT_ORDER | CMD_MSG(STR_ERROR_CAN_T_INSERT_NEW_ORDER));