summaryrefslogtreecommitdiff
path: root/src/ai/api/ai_town.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-08-27 13:47:03 +0000
committersmatz <smatz@openttd.org>2009-08-27 13:47:03 +0000
commit072ce4bb17dcb02e8e832f46e4fcadfd7c4be944 (patch)
treea7db2661ae804f06e41ab9b237e7a9e2558be39b /src/ai/api/ai_town.cpp
parent100ae8efcc592ec44f0cc161e0045fb84b67c45e (diff)
downloadopenttd-072ce4bb17dcb02e8e832f46e4fcadfd7c4be944.tar.xz
(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
Diffstat (limited to 'src/ai/api/ai_town.cpp')
-rw-r--r--src/ai/api/ai_town.cpp22
1 files changed, 4 insertions, 18 deletions
diff --git a/src/ai/api/ai_town.cpp b/src/ai/api/ai_town.cpp
index 9f497047d..72f068f09 100644
--- a/src/ai/api/ai_town.cpp
+++ b/src/ai/api/ai_town.cpp
@@ -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;
}
}