diff options
author | rubidium <rubidium@openttd.org> | 2011-02-04 15:37:23 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2011-02-04 15:37:23 +0000 |
commit | 46b3d114a828916226d66ec7536af9f62948759a (patch) | |
tree | b85595b42c2c58187284ee89452b8e71709ceeae /src/ai | |
parent | 4355231f677b2ad779daaab701444c5b003cdaed (diff) | |
download | openttd-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.cpp | 4 |
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) |