summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorterkhen <terkhen@openttd.org>2010-12-21 14:00:58 +0000
committerterkhen <terkhen@openttd.org>2010-12-21 14:00:58 +0000
commitea7c33ca6d6e81be028816b88da3040086811fad (patch)
treef82bd44adc12e64b2538a91896009bc56cd76e21
parent3e6ebc7158332e4d3fd604be458d3565b8c052f7 (diff)
downloadopenttd-ea7c33ca6d6e81be028816b88da3040086811fad.tar.xz
(svn r21569) -Add: Don't close the refit window after refitting only a consist part.
-rw-r--r--src/vehicle_gui.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp
index 3a20cd2f8..0605d940f 100644
--- a/src/vehicle_gui.cpp
+++ b/src/vehicle_gui.cpp
@@ -806,7 +806,8 @@ struct RefitWindow : public Window {
const Vehicle *v = Vehicle::Get(this->window_number);
if (this->order == INVALID_VEH_ORDER_ID) {
- if (DoCommandP(v->tile, this->selected_vehicle, this->cargo->cargo | this->cargo->subtype << 8 | this->num_vehicles << 17, GetCmdRefitVeh(v))) delete this;
+ bool delete_window = this->selected_vehicle == v->index && this->num_vehicles == UINT8_MAX;
+ if (DoCommandP(v->tile, this->selected_vehicle, this->cargo->cargo | this->cargo->subtype << 8 | this->num_vehicles << 17, GetCmdRefitVeh(v)) && delete_window) delete this;
} else {
if (DoCommandP(v->tile, v->index, this->cargo->cargo | this->cargo->subtype << 8 | this->order << 16, CMD_ORDER_REFIT)) delete this;
}