summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2012-01-25 20:46:51 +0000
committerrubidium <rubidium@openttd.org>2012-01-25 20:46:51 +0000
commit30c38502254e4fabdbc2364216d6181fffb86aef (patch)
tree9f6e3b8b37ff982d3e7d871a8d255cfafe8e6a0d
parent0c2c7d0edf7ab5a04d32a70feb8cf572d39f6c20 (diff)
downloadopenttd-30c38502254e4fabdbc2364216d6181fffb86aef.tar.xz
(svn r23851) -Fix: infrastructure cache could get out of sync when overbuilding a drive through road stop
-rw-r--r--src/station_cmd.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index b22630717..2763f7c06 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -1801,9 +1801,9 @@ CommandCost CmdBuildRoadStop(TileIndex tile, DoCommandFlag flags, uint32 p1, uin
* road tile, count only the new road bits needed to get a full diagonal road. */
RoadType rt;
FOR_EACH_SET_ROADTYPE(rt, cur_rts | rts) {
- Company *c = Company::GetIfValid(IsNormalRoadTile(cur_tile) && HasBit(cur_rts, rt) ? GetRoadOwner(cur_tile, rt) : _current_company);
+ Company *c = Company::GetIfValid(rt == ROADTYPE_ROAD ? road_owner : tram_owner);
if (c != NULL) {
- c->infrastructure.road[rt] += 2 - (IsNormalRoadTile(cur_tile) ? CountBits(GetRoadBits(cur_tile, rt)) : 0);
+ c->infrastructure.road[rt] += 2 - (IsNormalRoadTile(cur_tile) && HasBit(cur_rts, rt) ? CountBits(GetRoadBits(cur_tile, rt)) : 0);
DirtyCompanyInfrastructureWindows(c->index);
}
}