(svn r21959) -Change: replace longbridges with custom maximum bridge and tunnel length setting

This commit is contained in:
rubidium
2011-02-04 15:37:23 +00:00
parent 8ee493b6e9
commit 7086bb3017
10 changed files with 37 additions and 34 deletions

View File

@@ -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)