summaryrefslogtreecommitdiff
path: root/src/ai
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-02-04 15:37:23 +0000
committerrubidium <rubidium@openttd.org>2011-02-04 15:37:23 +0000
commit46b3d114a828916226d66ec7536af9f62948759a (patch)
treeb85595b42c2c58187284ee89452b8e71709ceeae /src/ai
parent4355231f677b2ad779daaab701444c5b003cdaed (diff)
downloadopenttd-46b3d114a828916226d66ec7536af9f62948759a.tar.xz
(svn r21959) -Change: replace longbridges with custom maximum bridge and tunnel length setting
Diffstat (limited to 'src/ai')
-rw-r--r--src/ai/api/ai_bridge.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/ai/api/ai_bridge.cpp b/src/ai/api/ai_bridge.cpp
index ab2156737..a051e85a2 100644
--- a/src/ai/api/ai_bridge.cpp
+++ b/src/ai/api/ai_bridge.cpp
@@ -152,9 +152,7 @@ static void _DoCommandReturnBuildBridge1(class AIInstance *instance)
{
if (!IsValidBridge(bridge_id)) return -1;
- uint max = ::GetBridgeSpec(bridge_id)->max_length;
- if (max >= MAX_BRIDGE_LENGTH && _settings_game.construction.longbridges) max = MAX_BRIDGE_LENGTH_LONGBRIDGES;
- return max + 2;
+ return min(::GetBridgeSpec(bridge_id)->max_length, _settings_game.construction.max_bridge_length) + 2;
}
/* static */ int32 AIBridge::GetMinLength(BridgeID bridge_id)