summaryrefslogtreecommitdiff
path: root/src/order_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-07-22 08:59:57 +0000
committerrubidium <rubidium@openttd.org>2009-07-22 08:59:57 +0000
commit68ead6b84f56ad3c93d05ad3e09b7fbb8173cf26 (patch)
treeee33bd19b96a138530a84e86e7ffd60c0700f9d9 /src/order_gui.cpp
parent2646a99d29535a44c5998f080131cbca2e85bdcf (diff)
downloadopenttd-68ead6b84f56ad3c93d05ad3e09b7fbb8173cf26.tar.xz
(svn r16909) -Fix [FS#2996]: NewGRF stations would be triggering assertions all over the place when using the more advanced station types.
-Change: make (rail) waypoints sub classes of 'base stations', make buoys waypoints and unify code between them where possible.
Diffstat (limited to 'src/order_gui.cpp')
-rw-r--r--src/order_gui.cpp22
1 files changed, 6 insertions, 16 deletions
diff --git a/src/order_gui.cpp b/src/order_gui.cpp
index 4548fbbc1..9413788a4 100644
--- a/src/order_gui.cpp
+++ b/src/order_gui.cpp
@@ -253,15 +253,8 @@ void DrawOrderString(const Vehicle *v, const Order *order, int order_index, int
break;
case OT_GOTO_WAYPOINT:
- if (v->type == VEH_TRAIN) {
- SetDParam(1, (order->GetNonStopType() & ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS) ? STR_GO_NON_STOP_TO_WAYPOINT : STR_GO_TO_WAYPOINT);
- SetDParam(2, order->GetDestination());
- } else {
- SetDParam(1, STR_GO_TO_STATION);
- SetDParam(2, STR_ORDER_GO_VIA);
- SetDParam(3, order->GetDestination());
- SetDParam(4, STR_EMPTY);
- }
+ SetDParam(1, (order->GetNonStopType() & ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS) ? STR_GO_NON_STOP_TO_WAYPOINT : STR_GO_TO_WAYPOINT);
+ SetDParam(2, order->GetDestination());
break;
case OT_CONDITIONAL:
@@ -357,7 +350,7 @@ static Order GetOrderCmdFromTile(const Vehicle *v, TileIndex tile)
return order;
}
- if (IsBuoyTile(tile) && v->type == VEH_SHIP) {
+ if ((IsBuoyTile(tile) && v->type == VEH_SHIP) || (IsRailWaypointTile(tile) && v->type == VEH_TRAIN)) {
order.MakeGoToWaypoint(GetStationIndex(tile));
return order;
}
@@ -775,12 +768,9 @@ public:
this->SetWidgetLoweredState(ORDER_WIDGET_NON_STOP, order->GetNonStopType() & ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS);
switch (order->GetType()) {
case OT_GOTO_STATION:
- if (!Station::Get(order->GetDestination())->IsBuoy()) {
- this->SetWidgetLoweredState(ORDER_WIDGET_FULL_LOAD, order->GetLoadType() == OLF_FULL_LOAD_ANY);
- this->SetWidgetLoweredState(ORDER_WIDGET_UNLOAD, order->GetUnloadType() == OUFB_UNLOAD);
- break;
- }
- /* Fall-through */
+ this->SetWidgetLoweredState(ORDER_WIDGET_FULL_LOAD, order->GetLoadType() == OLF_FULL_LOAD_ANY);
+ this->SetWidgetLoweredState(ORDER_WIDGET_UNLOAD, order->GetUnloadType() == OUFB_UNLOAD);
+ break;
case OT_GOTO_WAYPOINT:
this->DisableWidget(ORDER_WIDGET_FULL_LOAD_DROPDOWN);