summaryrefslogtreecommitdiff
path: root/src/rail_cmd.cpp
diff options
context:
space:
mode:
authormichi_cc <michi_cc@openttd.org>2011-12-03 23:40:18 +0000
committermichi_cc <michi_cc@openttd.org>2011-12-03 23:40:18 +0000
commita29a9d94b7216e41dc6d7f96345d2f66e882c89a (patch)
tree1bc66f82c6144656669317ee2b33997336e9a84d /src/rail_cmd.cpp
parentd30fcd4e354325af0d2b1968cd11c9db36a3e617 (diff)
downloadopenttd-a29a9d94b7216e41dc6d7f96345d2f66e882c89a.tar.xz
(svn r23412) -Add: Company infrastructure counts for road.
Diffstat (limited to 'src/rail_cmd.cpp')
-rw-r--r--src/rail_cmd.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp
index 5e00bfcb2..d4442a9b9 100644
--- a/src/rail_cmd.cpp
+++ b/src/rail_cmd.cpp
@@ -454,7 +454,15 @@ CommandCost CmdBuildSingleRail(TileIndex tile, DoCommandFlag flags, uint32 p1, u
default: break;
case ROADTYPES_TRAM:
/* Tram crossings must always have road. */
- if (flags & DC_EXEC) SetRoadOwner(tile, ROADTYPE_ROAD, _current_company);
+ if (flags & DC_EXEC) {
+ SetRoadOwner(tile, ROADTYPE_ROAD, _current_company);
+ Company *c = Company::GetIfValid(_current_company);
+ if (c != NULL) {
+ /* A full diagonal tile has two road bits. */
+ c->infrastructure.road[ROADTYPE_ROAD] += 2;
+ DirtyCompanyInfrastructureWindows(c->index);
+ }
+ }
roadtypes |= ROADTYPES_ROAD;
break;