mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-30 07:34:37 +01:00
(svn r17293) -Fix [NoAI]: AITown::GetLastMonthTransported didn't work as documented at all, make it return what AITown::GetLastMonthProduction did
-Change [NoAI]: mark AITown::GetMaxProduction as deprecated, AITown::GetLastMonthProduction returns now the value GetMaxProduction did
This commit is contained in:
@@ -72,8 +72,8 @@
|
||||
const Town *t = ::Town::Get(town_id);
|
||||
|
||||
switch (AICargo::GetTownEffect(cargo_id)) {
|
||||
case AICargo::TE_PASSENGERS: return t->act_pass;
|
||||
case AICargo::TE_MAIL: return t->act_mail;
|
||||
case AICargo::TE_PASSENGERS: return t->max_pass;
|
||||
case AICargo::TE_MAIL: return t->max_mail;
|
||||
default: return -1;
|
||||
}
|
||||
}
|
||||
@@ -86,22 +86,8 @@
|
||||
const Town *t = ::Town::Get(town_id);
|
||||
|
||||
switch (AICargo::GetTownEffect(cargo_id)) {
|
||||
case AICargo::TE_PASSENGERS: return t->pct_pass_transported;
|
||||
case AICargo::TE_MAIL: return t->pct_mail_transported;
|
||||
default: return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/* static */ int32 AITown::GetMaxProduction(TownID town_id, CargoID cargo_id)
|
||||
{
|
||||
if (!IsValidTown(town_id)) return -1;
|
||||
if (!AICargo::IsValidCargo(cargo_id)) return -1;
|
||||
|
||||
const Town *t = ::Town::Get(town_id);
|
||||
|
||||
switch (AICargo::GetTownEffect(cargo_id)) {
|
||||
case AICargo::TE_PASSENGERS: return t->max_pass;
|
||||
case AICargo::TE_MAIL: return t->max_mail;
|
||||
case AICargo::TE_PASSENGERS: return t->act_pass;
|
||||
case AICargo::TE_MAIL: return t->act_mail;
|
||||
default: return -1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user