(svn r23413) -Add: Company infrastructure counts for canals.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user