Changeset - r14878:df7e7e7ce347
[Not reviewed]
master
0 1 0
alberth - 14 years ago 2010-03-20 15:32:58
alberth@openttd.org
(svn r19484) -Codechange: Rename parameter 'x' of CalcBridgeLenCostFactor() to 'length'.
1 file changed with 5 insertions and 5 deletions:
0 comments (0 inline, 0 general)
src/tunnelbridge_cmd.cpp
Show inline comments
 
@@ -71,17 +71,17 @@ void ResetBridges()
 
 * @param length Length of the bridge.
 
 * @return Price factor for the bridge.
 
 */
 
int CalcBridgeLenCostFactor(int x)
 
int CalcBridgeLenCostFactor(int length)
 
{
 
	int n;
 
	int r;
 

	
 
	if (x < 2) return x;
 
	x -= 2;
 
	if (length < 2) return length;
 
	length -= 2;
 
	for (n = 0, r = 2;; n++) {
 
		if (x <= n) return r + x * n;
 
		if (length <= n) return r + length * n;
 
		r += n * n;
 
		x -= n;
 
		length -= n;
 
	}
 
}
 

	
0 comments (0 inline, 0 general)