mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r2427) - Fix: CmdMoveRailVehice; Prevent possible assertion failure when moving vehicles within one chain.
This commit is contained in:
parent
ac1af7848e
commit
4184611d3a
|
@ -845,6 +845,9 @@ int32 CmdMoveRailVehicle(int x, int y, uint32 flags, uint32 p1, uint32 p2)
|
||||||
src_head = NULL;
|
src_head = NULL;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
// if moving within the same chain, dont use dst_head as it may get invalidated
|
||||||
|
if (src_head == dst_head)
|
||||||
|
dst_head = NULL;
|
||||||
// unlink single wagon from linked list
|
// unlink single wagon from linked list
|
||||||
src_head = UnlinkWagon(src, src_head);
|
src_head = UnlinkWagon(src, src_head);
|
||||||
src->next = NULL;
|
src->next = NULL;
|
||||||
|
|
Loading…
Reference in New Issue