From 75aad2a1865f7e29b3a5cfa95a5115b97b114d66 Mon Sep 17 00:00:00 2001 From: rubidium Date: Thu, 3 Sep 2009 10:58:26 +0000 Subject: (svn r17401) -Fix [FS#3171] (r17384): order deletion didn't (correctly) update the order window --- src/order_gui.cpp | 6 ++++-- 1 file 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; -- cgit v1.2.3-54-g00ecf