mirror of https://github.com/OpenTTD/OpenTTD
(svn r19484) -Codechange: Rename parameter 'x' of CalcBridgeLenCostFactor() to 'length'.
parent
f05a8635fd
commit
cced6b35cb
|
@ -71,17 +71,17 @@ void ResetBridges()
|
||||||
* @param length Length of the bridge.
|
* @param length Length of the bridge.
|
||||||
* @return Price factor for the bridge.
|
* @return Price factor for the bridge.
|
||||||
*/
|
*/
|
||||||
int CalcBridgeLenCostFactor(int x)
|
int CalcBridgeLenCostFactor(int length)
|
||||||
{
|
{
|
||||||
int n;
|
int n;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
if (x < 2) return x;
|
if (length < 2) return length;
|
||||||
x -= 2;
|
length -= 2;
|
||||||
for (n = 0, r = 2;; n++) {
|
for (n = 0, r = 2;; n++) {
|
||||||
if (x <= n) return r + x * n;
|
if (length <= n) return r + length * n;
|
||||||
r += n * n;
|
r += n * n;
|
||||||
x -= n;
|
length -= n;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue