summaryrefslogtreecommitdiff
path: root/src/ai/api/ai_bridgelist.cpp
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2009-02-14 21:17:35 +0000
committeryexo <yexo@openttd.org>2009-02-14 21:17:35 +0000
commit7d88077addf412c3d2c392c4b16d6adaec0d006e (patch)
tree05b9b751f604a46d2d479768bb5f35bfd5ca3446 /src/ai/api/ai_bridgelist.cpp
parent16954ba37806a4510e626d5ceb29f8114c275a3d (diff)
downloadopenttd-7d88077addf412c3d2c392c4b16d6adaec0d006e.tar.xz
(svn r15490) -Change [API CHANGE]: Remove AIBridge::GetYearAvailable. AIBridge::IsValidBridge now only returns true for available bridges.
Diffstat (limited to 'src/ai/api/ai_bridgelist.cpp')
-rw-r--r--src/ai/api/ai_bridgelist.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/ai/api/ai_bridgelist.cpp b/src/ai/api/ai_bridgelist.cpp
index 9fd6728c2..2c4f36af9 100644
--- a/src/ai/api/ai_bridgelist.cpp
+++ b/src/ai/api/ai_bridgelist.cpp
@@ -9,16 +9,16 @@
AIBridgeList::AIBridgeList()
{
- /* Add all bridges, no matter if they are available or not */
- for (byte j = 0; j < MAX_BRIDGES; j++)
- if (::GetBridgeSpec(j)->avail_year <= _cur_year)
- this->AddItem(j);
+ for (byte j = 0; j < MAX_BRIDGES; j++) {
+ if (AIBridge::IsValidBridge(j)) this->AddItem(j);
+ }
}
AIBridgeList_Length::AIBridgeList_Length(uint length)
{
- for (byte j = 0; j < MAX_BRIDGES; j++)
- if (::GetBridgeSpec(j)->avail_year <= _cur_year)
- if (length >= (uint)AIBridge::GetMinLength(j) && length <= (uint)AIBridge::GetMaxLength(j))
- this->AddItem(j);
+ for (byte j = 0; j < MAX_BRIDGES; j++) {
+ if (AIBridge::IsValidBridge(j)) {
+ if (length >= (uint)AIBridge::GetMinLength(j) && length <= (uint)AIBridge::GetMaxLength(j)) this->AddItem(j);
+ }
+ }
}