(svn r2427) - Fix: CmdMoveRailVehice; Prevent possible assertion failure when moving vehicles within one chain.

replace/41b28d7194a279bdc17475d4fbe2ea6ec885a466
hackykid 20 years ago
parent ac1af7848e
commit 4184611d3a

@ -845,6 +845,9 @@ int32 CmdMoveRailVehicle(int x, int y, uint32 flags, uint32 p1, uint32 p2)
src_head = NULL;
}
} 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
src_head = UnlinkWagon(src, src_head);
src->next = NULL;

Loading…
Cancel
Save