Mercurial > hg > openttd
changeset 12909:082fb426c8cf draft
(svn r17401) -Fix [FS#3171] (r17384): order deletion didn't (correctly) update the order window
author | rubidium <rubidium@openttd.org> |
---|---|
date | Thu, 03 Sep 2009 10:58:26 +0000 |
parents | 730eacf8ad29 |
children | 57cb6eb5b9ab |
files | src/order_gui.cpp |
diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -606,6 +606,7 @@ 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 @@ 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 @@ 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 @@ 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;