summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-09-03 10:58:26 +0000
committerrubidium <rubidium@openttd.org>2009-09-03 10:58:26 +0000
commit75aad2a1865f7e29b3a5cfa95a5115b97b114d66 (patch)
tree05dfc027d7744f332e45704e44f7839d83407316
parentb294497f2a7bbcb9979a2e5210f3d638cb0da462 (diff)
downloadopenttd-75aad2a1865f7e29b3a5cfa95a5115b97b114d66.tar.xz
(svn r17401) -Fix [FS#3171] (r17384): order deletion didn't (correctly) update the order window
-rw-r--r--src/order_gui.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/order_gui.cpp b/src/order_gui.cpp
index ddbcee345..3604a69fa 100644
--- a/src/order_gui.cpp
+++ b/src/order_gui.cpp
@@ -606,6 +606,7 @@ private:
if (DoCommandP(w->vehicle->tile, w->vehicle->index, w->OrderGetSel(), CMD_DELETE_ORDER | CMD_MSG(STR_ERROR_CAN_T_DELETE_THIS_ORDER))) {
w->selected_order = selected >= w->vehicle->GetNumOrders() ? -1 : selected;
+ w->UpdateButtonState();
}
}
@@ -725,7 +726,7 @@ public:
void UpdateButtonState()
{
bool shared_orders = this->vehicle->IsOrderListShared();
- int sel = OrderGetSel();
+ int sel = this->OrderGetSel();
const Order *order = this->vehicle->GetOrder(sel);
if (this->vehicle->owner == _local_company) {
@@ -833,7 +834,7 @@ public:
virtual void OnPaint()
{
bool shared_orders = this->vehicle->IsOrderListShared();
- int sel = OrderGetSel();
+ int sel = this->OrderGetSel();
const Order *order = this->vehicle->GetOrder(sel);
if (this->vehicle->owner == _local_company) {
@@ -1083,6 +1084,7 @@ public:
if (!(from_order == to_order || from_order == INVALID_ORDER || from_order > this->vehicle->GetNumOrders() || to_order == INVALID_ORDER || to_order > this->vehicle->GetNumOrders()) &&
DoCommandP(this->vehicle->tile, this->vehicle->index, from_order | (to_order << 16), CMD_MOVE_ORDER | CMD_MSG(STR_ERROR_CAN_T_MOVE_THIS_ORDER))) {
this->selected_order = -1;
+ this->UpdateButtonState();
}
} break;