summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/road_cmd.cpp10
-rw-r--r--src/station_cmd.cpp1
2 files changed, 9 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);
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index f5ecd727c..eb90c29ab 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -1957,6 +1957,7 @@ static CommandCost RemoveRoadStop(TileIndex tile, DoCommandFlag flags)
}
}
Company::Get(st->owner)->infrastructure.station--;
+ DirtyCompanyInfrastructureWindows(st->owner);
if (IsDriveThroughStopTile(tile)) {
/* Clears the tile for us */