summaryrefslogtreecommitdiff
path: root/src/road_cmd.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2015-06-21 09:19:27 +0000
committerfrosch <frosch@openttd.org>2015-06-21 09:19:27 +0000
commit62bc57db776192d9f1988628dfb1f27392f86c40 (patch)
treee6767630bbd3cc987b869310abb1da88a439e080 /src/road_cmd.cpp
parent0731af42fda95a6c4e70f7b5ecfe4a8dc84093d3 (diff)
downloadopenttd-62bc57db776192d9f1988628dfb1f27392f86c40.tar.xz
(svn r27311) -Fix: Mark infrastructure window dirty in more cases. (marcole)
Diffstat (limited to 'src/road_cmd.cpp')
-rw-r--r--src/road_cmd.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp
index 449a8016b..08db2fd95 100644
--- a/src/road_cmd.cpp
+++ b/src/road_cmd.cpp
@@ -384,7 +384,10 @@ static CommandCost RemoveRoad(TileIndex tile, DoCommandFlag flags, RoadBits piec
/* Update rail count for level crossings. The plain track should still be accounted
* for, so only subtract the difference to the level crossing cost. */
c = Company::GetIfValid(GetTileOwner(tile));
- if (c != NULL) c->infrastructure.rail[GetRailType(tile)] -= LEVELCROSSING_TRACKBIT_FACTOR - 1;
+ if (c != NULL) {
+ c->infrastructure.rail[GetRailType(tile)] -= LEVELCROSSING_TRACKBIT_FACTOR - 1;
+ DirtyCompanyInfrastructureWindows(c->index);
+ }
} else {
SetRoadTypes(tile, rts);
}
@@ -638,7 +641,10 @@ CommandCost CmdBuildRoad(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
/* Update rail count for level crossings. The plain track is already
* counted, so only add the difference to the level crossing cost. */
c = Company::GetIfValid(GetTileOwner(tile));
- if (c != NULL) c->infrastructure.rail[GetRailType(tile)] += LEVELCROSSING_TRACKBIT_FACTOR - 1;
+ if (c != NULL) {
+ c->infrastructure.rail[GetRailType(tile)] += LEVELCROSSING_TRACKBIT_FACTOR - 1;
+ DirtyCompanyInfrastructureWindows(c->index);
+ }
/* Always add road to the roadtypes (can't draw without it) */
bool reserved = HasBit(GetRailReservationTrackBits(tile), railtrack);