|
@@ -175,25 +175,25 @@ bool Engine::CanCarryCargo() const
|
|
|
break;
|
|
|
|
|
|
case VEH_ROAD:
|
|
|
if (this->u.road.capacity == 0) return false;
|
|
|
break;
|
|
|
|
|
|
case VEH_SHIP:
|
|
|
case VEH_AIRCRAFT:
|
|
|
break;
|
|
|
|
|
|
default: NOT_REACHED();
|
|
|
}
|
|
|
return this->GetDefaultCargoType() != CT_INVALID;
|
|
|
return IsValidCargoID(this->GetDefaultCargoType());
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* Determines capacity of a given vehicle from scratch.
|
|
|
* For aircraft the main capacity is determined. Mail might be present as well.
|
|
|
* @param v Vehicle of interest; nullptr in purchase list
|
|
|
* @param mail_capacity returns secondary cargo (mail) capacity of aircraft
|
|
|
* @return Capacity
|
|
|
*/
|
|
|
uint Engine::DetermineCapacity(const Vehicle *v, uint16 *mail_capacity) const
|
|
|
{
|
|
@@ -1247,25 +1247,25 @@ bool IsEngineRefittable(EngineID engine)
|
|
|
|
|
|
const EngineInfo *ei = &e->info;
|
|
|
if (ei->refit_mask == 0) return false;
|
|
|
|
|
|
/* 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();
|
|
|
CargoTypes default_cargo_mask = 0;
|
|
|
SetBit(default_cargo_mask, default_cargo);
|
|
|
return default_cargo != CT_INVALID && ei->refit_mask != default_cargo_mask;
|
|
|
return IsValidCargoID(default_cargo) && ei->refit_mask != default_cargo_mask;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* Check for engines that have an appropriate availability.
|
|
|
*/
|
|
|
void CheckEngines()
|
|
|
{
|
|
|
TimerGameCalendar::Date min_date = INT32_MAX;
|
|
|
|
|
|
for (const Engine *e : Engine::Iterate()) {
|
|
|
if (!e->IsEnabled()) continue;
|
|
|
|