|
@@ -2055,49 +2055,49 @@ int WhoCanServiceIndustry(Industry *ind)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* Report news that industry production has changed significantly
|
|
|
*
|
|
|
* @param ind: Industry with changed production
|
|
|
* @param type: Cargo type that has changed
|
|
|
* @param percent: Percentage of change (>0 means increase, <0 means decrease)
|
|
|
*/
|
|
|
static void ReportNewsProductionChangeIndustry(Industry *ind, CargoID type, int percent)
|
|
|
{
|
|
|
NewsSubtype ns;
|
|
|
|
|
|
switch (WhoCanServiceIndustry(ind)) {
|
|
|
case 0: ns = NS_INDUSTRY_NOBODY; break;
|
|
|
case 1: ns = NS_INDUSTRY_OTHER; break;
|
|
|
case 2: ns = NS_INDUSTRY_COMPANY; break;
|
|
|
default: NOT_REACHED();
|
|
|
}
|
|
|
SetDParam(2, abs(percent));
|
|
|
SetDParam(0, GetCargo(type)->name);
|
|
|
SetDParam(0, CargoSpec::Get(type)->name);
|
|
|
SetDParam(1, ind->index);
|
|
|
AddIndustryNewsItem(
|
|
|
percent >= 0 ? STR_NEWS_INDUSTRY_PRODUCTION_INCREASE_SMOOTH : STR_NEWS_INDUSTRY_PRODUCTION_DECREASE_SMOOTH,
|
|
|
ns,
|
|
|
ind->index
|
|
|
);
|
|
|
}
|
|
|
|
|
|
enum {
|
|
|
PERCENT_TRANSPORTED_60 = 153,
|
|
|
PERCENT_TRANSPORTED_80 = 204,
|
|
|
};
|
|
|
|
|
|
/** Change industry production or do closure
|
|
|
* @param i Industry for which changes are performed
|
|
|
* @param monthly true if it's the monthly call, false if it's the random call
|
|
|
*/
|
|
|
static void ChangeIndustryProduction(Industry *i, bool monthly)
|
|
|
{
|
|
|
StringID str = STR_NULL;
|
|
|
bool closeit = false;
|
|
|
const IndustrySpec *indspec = GetIndustrySpec(i->type);
|
|
|
bool standard = false;
|
|
|
bool suppress_message = false;
|