Changeset - r2833:35ddad9f0bb4
[Not reviewed]
master
0 1 0
truelight - 19 years ago 2006-01-07 10:57:32
truelight@openttd.org
(svn r3381) -Fix: r3374 left one bug: allow moving around wagons in a 100 long train
1 file changed with 3 insertions and 1 deletions:
0 comments (0 inline, 0 general)
train_cmd.c
Show inline comments
 
@@ -996,25 +996,27 @@ int32 CmdMoveRailVehicle(int x, int y, u
 

	
 
		r = CheckTrainStoppedInDepot(src_head);
 
		/* check if all vehicles in the source train are stopped inside a depot */
 
		if (r < 0) return CMD_ERROR;
 

	
 
		num += r;
 

	
 
		/* check if all the vehicles in the dest train are stopped */
 
		if (dst_head != NULL) {
 
			r = CheckTrainStoppedInDepot(dst_head);
 
			if (r < 0) return CMD_ERROR;
 

	
 
			num += r;
 
			/* If we move in the same vehicle, it is okay */
 
			if (dst_head != src_head)
 
				num += r;
 

	
 
			assert(dst_head->tile == src_head->tile);
 
		}
 

	
 
		/* Check that the length of the dest train is no longer than XXX vehicles */
 
		if (num > (_patches.mammoth_trains ? 100 : 9) && IsFrontEngine(dst_head))
 
			return_cmd_error(STR_8819_TRAIN_TOO_LONG);
 
	}
 

	
 
	// when moving all wagons, we can't have the same src_head and dst_head
 
	if (HASBIT(p2, 0) && src_head == dst_head) return 0;
 

	
0 comments (0 inline, 0 general)