(svn r23413) -Add: Company infrastructure counts for canals.

This commit is contained in:
michi_cc
2011-12-03 23:40:23 +00:00
parent a29a9d94b7
commit c06bbb4863
6 changed files with 116 additions and 4 deletions

View File

@@ -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();