src/autoreplace_cmd.cpp
changeset 6491 00dc414c909d
parent 6264 c2138d65160b
child 6505 8b4c20ddacd3
equal deleted inserted replaced
6490:fe4443fba5e3 6491:00dc414c909d
   135 	do {
   135 	do {
   136 		if (v->cargo_cap == 0) continue;
   136 		if (v->cargo_cap == 0) continue;
   137 		/* Now we found a cargo type being carried on the train and we will see if it is possible to carry to this one */
   137 		/* Now we found a cargo type being carried on the train and we will see if it is possible to carry to this one */
   138 		if (v->cargo_type == new_cargo_type) return CT_NO_REFIT;
   138 		if (v->cargo_type == new_cargo_type) return CT_NO_REFIT;
   139 		if (CanRefitTo(engine_type, v->cargo_type)) return v->cargo_type;
   139 		if (CanRefitTo(engine_type, v->cargo_type)) return v->cargo_type;
   140 	} while ((v=v->next) != NULL);
   140 	} while ((v = v->next) != NULL);
   141 	return CT_NO_REFIT; // We failed to find a cargo type on the old vehicle and we will not refit the new one
   141 	return CT_NO_REFIT; // We failed to find a cargo type on the old vehicle and we will not refit the new one
   142 }
   142 }
   143 
   143 
   144 /* Replaces a vehicle (used to be called autorenew)
   144 /* Replaces a vehicle (used to be called autorenew)
   145  * This function is only called from MaybeReplaceVehicle()
   145  * This function is only called from MaybeReplaceVehicle()