Changeset - r4197:b768f39fadb6
[Not reviewed]
master
0 1 0
bjarni - 18 years ago 2006-07-30 22:43:50
bjarni@openttd.org
(svn r5664) -Fix: [SF 1518090 ] moving train engines in depot - crash (svn r5463)
this was present long before 5463
Darkvater deserves some of the credit for this fix since he discovered where the first pointer got set incorrectly
1 file changed with 2 insertions and 0 deletions:
0 comments (0 inline, 0 general)
train_cmd.c
Show inline comments
 
@@ -1153,12 +1153,14 @@ int32 CmdMoveRailVehicle(TileIndex tile,
 
		}
 
		if (src->u.rail.other_multiheaded_part != NULL) {
 
			if (src->u.rail.other_multiheaded_part == src_head) {
 
				src_head = src_head->next;
 
			}
 
			AddWagonToConsist(src->u.rail.other_multiheaded_part, src);
 
			// previous line set the front engine to the old front. We need to clear that
 
			src->u.rail.other_multiheaded_part->first = NULL;
 
		}
 

	
 
		if (HASBIT(p2, 0) && src_head != NULL && src_head != src) {
 
			/* if we stole a rear multiheaded engine, we better give it back to the front end */
 
			Vehicle *engine = NULL, *u;
 
			for (u = src_head; u != NULL; u = u->next) {
0 comments (0 inline, 0 general)