summaryrefslogtreecommitdiff
path: root/src/order_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-09-10 14:37:55 +0000
committerrubidium <rubidium@openttd.org>2009-09-10 14:37:55 +0000
commit860a538adc56a678f640f606692ea7ca00c8d424 (patch)
tree70ac11ef8b475179092b2a435fa768d761bcc3b5 /src/order_gui.cpp
parent751ea62f442f0a8b1623e3df0c0ac5971f776d40 (diff)
downloadopenttd-860a538adc56a678f640f606692ea7ca00c8d424.tar.xz
(svn r17495) -Codechange: replace 'Depot::Get(GetDepotIndex(tile))->index' with GetDepotIndex(tile)
Diffstat (limited to 'src/order_gui.cpp')
-rw-r--r--src/order_gui.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/order_gui.cpp b/src/order_gui.cpp
index 3604a69fa..288276ab8 100644
--- a/src/order_gui.cpp
+++ b/src/order_gui.cpp
@@ -303,7 +303,7 @@ 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(Depot::GetByTile(tile)->index, ODTFB_PART_OF_ORDERS,
+ order.MakeGoToDepot(GetDepotIndex(tile), 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));
return order;
@@ -313,7 +313,7 @@ static Order GetOrderCmdFromTile(const Vehicle *v, TileIndex tile)
case MP_ROAD:
if (IsRoadDepot(tile) && v->type == VEH_ROAD && IsTileOwner(tile, _local_company)) {
- order.MakeGoToDepot(Depot::GetByTile(tile)->index, ODTFB_PART_OF_ORDERS,
+ order.MakeGoToDepot(GetDepotIndex(tile), 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));
return order;
@@ -332,9 +332,7 @@ static Order GetOrderCmdFromTile(const Vehicle *v, TileIndex tile)
case MP_WATER:
if (v->type != VEH_SHIP) break;
if (IsShipDepot(tile) && IsTileOwner(tile, _local_company)) {
- TileIndex tile2 = GetOtherShipDepotTile(tile);
-
- order.MakeGoToDepot(Depot::GetByTile(tile < tile2 ? tile : tile2)->index, ODTFB_PART_OF_ORDERS, ONSF_STOP_EVERYWHERE);
+ order.MakeGoToDepot(GetDepotIndex(tile), ODTFB_PART_OF_ORDERS, ONSF_STOP_EVERYWHERE);
if (_ctrl_pressed) order.SetDepotOrderType((OrderDepotTypeFlags)(order.GetDepotOrderType() ^ ODTFB_SERVICE));
return order;
}