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

This commit is contained in:
hackykid 2005-06-06 21:32:04 +00:00
parent ac1af7848e
commit 4184611d3a
1 changed files with 3 additions and 0 deletions

View File

@ -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;