mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r9338) -Fix: close the Shared Order Vehicle List if you remove the shared link with only 2 vehicles
This commit is contained in:
parent
9435d8cc83
commit
58ef6ecc33
|
@ -1138,7 +1138,7 @@ void DeleteVehicleOrders(Vehicle *v)
|
||||||
/* If we have a shared order-list, don't delete the list, but just
|
/* If we have a shared order-list, don't delete the list, but just
|
||||||
remove our pointer */
|
remove our pointer */
|
||||||
if (IsOrderListShared(v)) {
|
if (IsOrderListShared(v)) {
|
||||||
const Vehicle *u = v;
|
Vehicle *u = v;
|
||||||
|
|
||||||
v->orders = NULL;
|
v->orders = NULL;
|
||||||
v->num_orders = 0;
|
v->num_orders = 0;
|
||||||
|
@ -1155,6 +1155,10 @@ void DeleteVehicleOrders(Vehicle *v)
|
||||||
v->prev_shared = NULL;
|
v->prev_shared = NULL;
|
||||||
v->next_shared = NULL;
|
v->next_shared = NULL;
|
||||||
|
|
||||||
|
/* If we are the only one left in the Shared Order Vehicle List,
|
||||||
|
* remove it, as we are no longer a Shared Order Vehicle */
|
||||||
|
if (u->prev_shared == NULL && u->next_shared == NULL) RemoveSharedOrderVehicleList(u);
|
||||||
|
|
||||||
/* We only need to update this-one, because if there is a third
|
/* We only need to update this-one, because if there is a third
|
||||||
* vehicle which shares the same order-list, nothing will change. If
|
* vehicle which shares the same order-list, nothing will change. If
|
||||||
* this is the last vehicle, the last line of the order-window
|
* this is the last vehicle, the last line of the order-window
|
||||||
|
|
Loading…
Reference in New Issue