summaryrefslogtreecommitdiff
path: root/src/station_cmd.cpp
diff options
context:
space:
mode:
authormichi_cc <michi_cc@openttd.org>2011-12-03 23:40:23 +0000
committermichi_cc <michi_cc@openttd.org>2011-12-03 23:40:23 +0000
commitc06bbb48634ce7b34c53fed37cfebf47248dcdc5 (patch)
tree08984de5f23a2101035d74c38dac8b38f4d5173b /src/station_cmd.cpp
parenta29a9d94b7216e41dc6d7f96345d2f66e882c89a (diff)
downloadopenttd-c06bbb48634ce7b34c53fed37cfebf47248dcdc5.tar.xz
(svn r23413) -Add: Company infrastructure counts for canals.
Diffstat (limited to 'src/station_cmd.cpp')
-rw-r--r--src/station_cmd.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 784ee78ae..839946214 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -2482,6 +2482,13 @@ CommandCost CmdBuildDock(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
tile + ToTileIndexDiff(_dock_tileoffs_chkaround[direction]),
_dock_w_chk[direction], _dock_h_chk[direction], StationRect::ADD_TRY);
+ /* If the water part of the dock is on a canal, update infrastructure counts.
+ * This is needed as we've unconditionally cleared that tile before. */
+ if (wc == WATER_CLASS_CANAL) {
+ Company::Get(st->owner)->infrastructure.water++;
+ DirtyCompanyInfrastructureWindows(st->owner);
+ }
+
MakeDock(tile, st->owner, st->index, direction, wc);
st->UpdateVirtCoord();