changeset 1921:828d36e8c6f7 draft

(svn r2427) - Fix: CmdMoveRailVehice; Prevent possible assertion failure when moving vehicles within one chain.
author hackykid <hackykid@openttd.org>
date Mon, 06 Jun 2005 21:32:04 +0000
parents 5d8d34930cd3
children 71fe89d907bf
files train_cmd.c
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/train_cmd.c
+++ b/train_cmd.c
@@ -845,6 +845,9 @@
 				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;