File diff r12029:5b077ec055c0 → r12030:bf346482c342
src/train_gui.cpp
Show inline comments
 
@@ -24,13 +24,12 @@ void CcBuildWagon(bool success, TileInde
 

	
 
	/* find a locomotive in the depot. */
 
	const Vehicle *found = NULL;
 
	const Vehicle *v;
 
	FOR_ALL_VEHICLES(v) {
 
		if (v->type == VEH_TRAIN && IsFrontEngine(v) &&
 
				v->tile == tile &&
 
				((const Train *)v)->track == TRACK_BIT_DEPOT) {
 
	const Train *t;
 
	FOR_ALL_TRAINS(t) {
 
		if (IsFrontEngine(t) && t->tile == tile &&
 
				t->track == TRACK_BIT_DEPOT) {
 
			if (found != NULL) return; // must be exactly one.
 
			found = v;
 
			found = t;
 
		}
 
	}