mirror of https://github.com/OpenTTD/OpenTTD
(svn r21569) -Add: Don't close the refit window after refitting only a consist part.
parent
3e6ebc7158
commit
ea7c33ca6d
|
@ -806,7 +806,8 @@ struct RefitWindow : public Window {
|
||||||
const Vehicle *v = Vehicle::Get(this->window_number);
|
const Vehicle *v = Vehicle::Get(this->window_number);
|
||||||
|
|
||||||
if (this->order == INVALID_VEH_ORDER_ID) {
|
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 {
|
} else {
|
||||||
if (DoCommandP(v->tile, v->index, this->cargo->cargo | this->cargo->subtype << 8 | this->order << 16, CMD_ORDER_REFIT)) delete this;
|
if (DoCommandP(v->tile, v->index, this->cargo->cargo | this->cargo->subtype << 8 | this->order << 16, CMD_ORDER_REFIT)) delete this;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue