|
@@ -29,13 +29,12 @@ extern void ChangeVehicleNews(VehicleID
|
|
|
extern void ChangeVehicleViewWindow(VehicleID from_index, VehicleID to_index);
|
|
|
|
|
|
/**
|
|
|
* Figure out if two engines got at least one type of cargo in common (refitting if needed)
|
|
|
* @param engine_a one of the EngineIDs
|
|
|
* @param engine_b the other EngineID
|
|
|
* @param type the type of the engines
|
|
|
* @return true if they can both carry the same type of cargo (or at least one of them got no capacity at all)
|
|
|
*/
|
|
|
static bool EnginesHaveCargoInCommon(EngineID engine_a, EngineID engine_b)
|
|
|
{
|
|
|
CargoTypes available_cargoes_a = GetUnionOfArticulatedRefitMasks(engine_a, true);
|
|
|
CargoTypes available_cargoes_b = GetUnionOfArticulatedRefitMasks(engine_b, true);
|
|
@@ -234,13 +233,13 @@ static CargoID GetNewCargoTypeForReplace
|
|
|
|
|
|
/**
|
|
|
* Get the EngineID of the replacement for a vehicle
|
|
|
* @param v The vehicle to find a replacement for
|
|
|
* @param c The vehicle's owner (it's faster to forward the pointer than refinding it)
|
|
|
* @param always_replace Always replace, even if not old.
|
|
|
* @param [out] e the EngineID of the replacement. INVALID_ENGINE if no replacement is found
|
|
|
* @param[out] e the EngineID of the replacement. INVALID_ENGINE if no replacement is found
|
|
|
* @return Error if the engine to build is not available
|
|
|
*/
|
|
|
static CommandCost GetNewEngineType(const Vehicle *v, const Company *c, bool always_replace, EngineID &e)
|
|
|
{
|
|
|
assert(v->type != VEH_TRAIN || !v->IsArticulatedPart());
|
|
|
|