src/autoreplace_cmd.cpp
changeset 6987 b0f13039bda2
parent 6590 9bbf8fdc5e91
child 7001 d5f19455d650
equal deleted inserted replaced
6986:168d3add1f13 6987:b0f13039bda2
   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()