mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r4675) - Backport from trunk (r4501):
Fix: When, in a train that has multiple engines in front, the _first_ of those engines is sold, all the orders are copied to the second engine (to ensure "seamless" operation). The next_shared/prev_shared pointers where not updated correctly during this operation.
This commit is contained in:
parent
a336c7cd0c
commit
d5bcaec677
10
train_cmd.c
10
train_cmd.c
|
@ -1288,6 +1288,16 @@ int32 CmdSellRailWagon(int x, int y, uint32 flags, uint32 p1, uint32 p2)
|
|||
new_f->current_order = first->current_order;
|
||||
new_f->cur_order_index = first->cur_order_index;
|
||||
new_f->orders = first->orders;
|
||||
if (first->prev_shared != NULL) {
|
||||
first->prev_shared->next_shared = new_f;
|
||||
new_f->prev_shared = first->prev_shared;
|
||||
}
|
||||
|
||||
if (first->next_shared != NULL) {
|
||||
first->next_shared->prev_shared = new_f;
|
||||
new_f->next_shared = first->next_shared;
|
||||
}
|
||||
|
||||
new_f->num_orders = first->num_orders;
|
||||
first->orders = NULL; // XXX - to not to delete the orders */
|
||||
if (IsLocalPlayer()) ShowTrainViewWindow(new_f);
|
||||
|
|
Loading…
Reference in New Issue