|
@@ -23,25 +23,24 @@
|
|
|
#include "table/strings.h"
|
|
|
|
|
|
#include "safeguards.h"
|
|
|
|
|
|
extern void ChangeVehicleViewports(VehicleID from_index, VehicleID to_index);
|
|
|
extern void ChangeVehicleNews(VehicleID from_index, VehicleID to_index);
|
|
|
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);
|
|
|
return (available_cargoes_a == 0 || available_cargoes_b == 0 || (available_cargoes_a & available_cargoes_b) != 0);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* Checks some basic properties whether autoreplace is allowed
|
|
|
* @param from Origin engine
|