diff options
author | michi_cc <michi_cc@openttd.org> | 2011-12-03 23:40:18 +0000 |
---|---|---|
committer | michi_cc <michi_cc@openttd.org> | 2011-12-03 23:40:18 +0000 |
commit | a29a9d94b7216e41dc6d7f96345d2f66e882c89a (patch) | |
tree | 1bc66f82c6144656669317ee2b33997336e9a84d /src/rail_cmd.cpp | |
parent | d30fcd4e354325af0d2b1968cd11c9db36a3e617 (diff) | |
download | openttd-a29a9d94b7216e41dc6d7f96345d2f66e882c89a.tar.xz |
(svn r23412) -Add: Company infrastructure counts for road.
Diffstat (limited to 'src/rail_cmd.cpp')
-rw-r--r-- | src/rail_cmd.cpp | 10 |
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; |