(svn r17294) -Add [NoAI]: AITown::GetLastMonthTransportedPercentage and AIIndustry::GetLastMonthTransportedPercentage
This commit is contained in:
@@ -98,6 +98,20 @@
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* static */ int32 AIIndustry::GetLastMonthTransportedPercentage(IndustryID industry_id, CargoID cargo_id)
|
||||
{
|
||||
if (!IsValidIndustry(industry_id)) return -1;
|
||||
if (!AICargo::IsValidCargo(cargo_id)) return -1;
|
||||
|
||||
const Industry *i = ::Industry::Get(industry_id);
|
||||
|
||||
for (byte j = 0; j < lengthof(i->produced_cargo); j++) {
|
||||
if (i->produced_cargo[j] == cargo_id) return ::ToPercent8(i->last_month_pct_transported[j]);
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* static */ TileIndex AIIndustry::GetLocation(IndustryID industry_id)
|
||||
{
|
||||
if (!IsValidIndustry(industry_id)) return INVALID_TILE;
|
||||
|
Reference in New Issue
Block a user