summaryrefslogtreecommitdiff
path: root/src/saveload
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/saveload
parenta29a9d94b7216e41dc6d7f96345d2f66e882c89a (diff)
downloadopenttd-c06bbb48634ce7b34c53fed37cfebf47248dcdc5.tar.xz
(svn r23413) -Add: Company infrastructure counts for canals.
Diffstat (limited to 'src/saveload')
-rw-r--r--src/saveload/company_sl.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/saveload/company_sl.cpp b/src/saveload/company_sl.cpp
index 4d4c50c9e..a51c32d7e 100644
--- a/src/saveload/company_sl.cpp
+++ b/src/saveload/company_sl.cpp
@@ -151,11 +151,32 @@ void AfterLoadCompanyStats()
break;
}
+ case STATION_DOCK:
+ case STATION_BUOY:
+ if (GetWaterClass(tile) == WATER_CLASS_CANAL) {
+ if (c != NULL) c->infrastructure.water++;
+ }
+ break;
+
default:
break;
}
break;
+ case MP_WATER:
+ if (IsShipDepot(tile) || IsLock(tile)) {
+ c = Company::GetIfValid(GetTileOwner(tile));
+ if (c != NULL) c->infrastructure.water += LOCK_DEPOT_TILE_FACTOR;
+ }
+ /* FALL THROUGH */
+
+ case MP_OBJECT:
+ if (GetWaterClass(tile) == WATER_CLASS_CANAL) {
+ c = Company::GetIfValid(GetTileOwner(tile));
+ if (c != NULL) c->infrastructure.water++;
+ }
+ break;
+
case MP_TUNNELBRIDGE: {
/* Only count the tunnel/bridge if we're on the northern end tile. */
TileIndex other_end = GetOtherTunnelBridgeEnd(tile);
@@ -180,6 +201,11 @@ void AfterLoadCompanyStats()
break;
}
+ case TRANSPORT_WATER:
+ c = Company::GetIfValid(GetTileOwner(tile));
+ if (c != NULL) c->infrastructure.water += len;
+ break;
+
default:
break;
}