Mercurial > hg > openttd
changeset 10004:4e67bcb0c5b1 draft
(svn r14162) -Fix: Allow rail type conversion if the rail type cost multipliers are the same.
author | peter1138 <peter1138@openttd.org> |
---|---|
date | Sun, 24 Aug 2008 23:29:58 +0000 |
parents | 225c6c30e9b8 |
children | 016cff5941c6 |
files | src/rail.h |
diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/rail.h +++ b/src/rail.h @@ -183,7 +183,8 @@ * (the price of workers to get to place is that 1/4) */ if (HasPowerOnRail(from, to)) { - return ((RailBuildCost(to) - RailBuildCost(from)) * 5) >> 2; + Money cost = ((RailBuildCost(to) - RailBuildCost(from)) * 5) >> 2; + if (cost != 0) return cost; } /* el. rail -> rail @@ -191,7 +192,8 @@ * (the price of workers is 1 / 4 + price of copper sold to a recycle center) */ if (HasPowerOnRail(to, from)) { - return (RailBuildCost(from) - RailBuildCost(to)) >> 2; + Money cost = (RailBuildCost(from) - RailBuildCost(to)) >> 2; + if (cost != 0) return cost; } /* make the price the same as remove + build new type */