train_cmd.c
branch0.4
changeset 10069 0cca43840d61
parent 10039 2f478be92946
equal deleted inserted replaced
10068:0d713ced91d5 10069:0cca43840d61
  1128 		if (src->u.rail.other_multiheaded_part != NULL) {
  1128 		if (src->u.rail.other_multiheaded_part != NULL) {
  1129 			if (src->u.rail.other_multiheaded_part == src_head) {
  1129 			if (src->u.rail.other_multiheaded_part == src_head) {
  1130 				src_head = src_head->next;
  1130 				src_head = src_head->next;
  1131 			}
  1131 			}
  1132 			AddWagonToConsist(src->u.rail.other_multiheaded_part, src);
  1132 			AddWagonToConsist(src->u.rail.other_multiheaded_part, src);
       
  1133 			// previous line set the front engine to the old front. We need to clear that
       
  1134 			src->u.rail.other_multiheaded_part->first = NULL;
  1133 		}
  1135 		}
  1134 
  1136 
  1135 		if (HASBIT(p2, 0) && src_head != NULL && src_head != src) {
  1137 		if (HASBIT(p2, 0) && src_head != NULL && src_head != src) {
  1136 			/* if we stole a rear multiheaded engine, we better give it back to the front end */
  1138 			/* if we stole a rear multiheaded engine, we better give it back to the front end */
  1137 			Vehicle *engine = NULL, *u;
  1139 			Vehicle *engine = NULL, *u;