diff options
author | michi_cc <michi_cc@openttd.org> | 2011-12-03 23:40:23 +0000 |
---|---|---|
committer | michi_cc <michi_cc@openttd.org> | 2011-12-03 23:40:23 +0000 |
commit | c06bbb48634ce7b34c53fed37cfebf47248dcdc5 (patch) | |
tree | 08984de5f23a2101035d74c38dac8b38f4d5173b /src/object_cmd.cpp | |
parent | a29a9d94b7216e41dc6d7f96345d2f66e882c89a (diff) | |
download | openttd-c06bbb48634ce7b34c53fed37cfebf47248dcdc5.tar.xz |
(svn r23413) -Add: Company infrastructure counts for canals.
Diffstat (limited to 'src/object_cmd.cpp')
-rw-r--r-- | src/object_cmd.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/object_cmd.cpp b/src/object_cmd.cpp index b44eebaff..fa7ea68dc 100644 --- a/src/object_cmd.cpp +++ b/src/object_cmd.cpp @@ -103,6 +103,11 @@ void BuildObject(ObjectType type, TileIndex tile, CompanyID owner, Town *town, u TILE_AREA_LOOP(t, ta) { WaterClass wc = (IsWaterTile(t) ? GetWaterClass(t) : WATER_CLASS_INVALID); + /* Update company infrastructure counts for objects build on canals owned by nobody. */ + if (wc == WATER_CLASS_CANAL && owner != OWNER_NONE && (IsTileOwner(tile, OWNER_NONE) || IsTileOwner(tile, OWNER_WATER))) { + Company::Get(owner)->infrastructure.water++; + DirtyCompanyInfrastructureWindows(owner); + } MakeObject(t, type, owner, o->index, wc, Random()); MarkTileDirtyByTile(t); } |