summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2013-06-24 21:01:05 +0000
committerfrosch <frosch@openttd.org>2013-06-24 21:01:05 +0000
commit58ae2d5aebc1b7a9ee067c30744ca3f076b61572 (patch)
tree8af2c9ea94f8fd255c8c01f1c0f392f33cf3fa69
parentbfbdbe688e76ed70d1f76b69d806904ffed0dd41 (diff)
downloadopenttd-58ae2d5aebc1b7a9ee067c30744ca3f076b61572.tar.xz
(svn r25458) -Fix-ish: Enable the autorefit-button in the order GUI in case the vehicle is not auto-refittable but already has a autorefit-order set to allow clearing the refit.
-rw-r--r--src/order_gui.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/order_gui.cpp b/src/order_gui.cpp
index 2b8d4926f..ebf143ee8 100644
--- a/src/order_gui.cpp
+++ b/src/order_gui.cpp
@@ -1022,8 +1022,11 @@ public:
this->SetWidgetLoweredState(WID_O_FULL_LOAD, order->GetLoadType() == OLF_FULL_LOAD_ANY);
this->SetWidgetLoweredState(WID_O_UNLOAD, order->GetUnloadType() == OUFB_UNLOAD);
- /* Can only do refitting when stopping at the destination and loading cargo. */
- this->SetWidgetDisabledState(WID_O_REFIT_DROPDOWN, !this->can_do_autorefit || order->GetLoadType() == OLFB_NO_LOAD || order->GetNonStopType() & ONSF_NO_STOP_AT_DESTINATION_STATION);
+ /* Can only do refitting when stopping at the destination and loading cargo.
+ * Also enable the button if a refit is already set to allow clearing it. */
+ this->SetWidgetDisabledState(WID_O_REFIT_DROPDOWN,
+ order->GetLoadType() == OLFB_NO_LOAD || (order->GetNonStopType() & ONSF_NO_STOP_AT_DESTINATION_STATION) ||
+ (!this->can_do_autorefit && !order->IsRefit()));
break;