@@ -749,13 +749,13 @@ static void AcceptEnginePreview(EngineID
*/
static CompanyID GetPreviewCompany(Engine *e)
{
CompanyID best_company = INVALID_COMPANY;
/* For trains the cargomask has no useful meaning, since you can attach other wagons */
uint32 cargomask = e->type != VEH_TRAIN ? GetUnionOfArticulatedRefitMasks(e->index, true) : (uint32)-1;
CargoTypes cargomask = e->type != VEH_TRAIN ? GetUnionOfArticulatedRefitMasks(e->index, true) : ALL_CARGOTYPES;
int32 best_hist = -1;
const Company *c;
FOR_ALL_COMPANIES(c) {
if (c->block_preview == 0 && !HasBit(e->preview_asked, c->index) &&
c->old_economy[0].performance_history > best_hist) {
@@ -1114,13 +1114,15 @@ bool IsEngineRefittable(EngineID engine)
/* Are there suffixes?
* Note: This does not mean the suffixes are actually available for every consist at any time. */
if (HasBit(ei->callback_mask, CBM_VEHICLE_CARGO_SUFFIX)) return true;
/* Is there any cargo except the default cargo? */
CargoID default_cargo = e->GetDefaultCargoType();
return default_cargo != CT_INVALID && ei->refit_mask != 1U << default_cargo;
CargoTypes default_cargo_mask = 0;
SetBit(default_cargo_mask, default_cargo);
return default_cargo != CT_INVALID && ei->refit_mask != default_cargo_mask;
}
/**
* Check for engines that have an appropriate availability.
void CheckEngines()