diff options
Diffstat (limited to 'indexer/feature_utils.cpp')
-rw-r--r-- | indexer/feature_utils.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/indexer/feature_utils.cpp b/indexer/feature_utils.cpp index 60fad6e9a5..71a1930231 100644 --- a/indexer/feature_utils.cpp +++ b/indexer/feature_utils.cpp @@ -48,6 +48,25 @@ public: uint8_t GetSearchRank(FeatureType const & feature) const { uint32_t const population = feature.GetPopulation(); + + FeatureBase::GetTypesFn types; + feature.ForEachTypeRef(types); + for (size_t i = 0; i < types.m_size; ++i) + { + if (types.m_types[i] == m_TypeVillage) + population = max(population, 1000); + else if (types.m_types[i] == m_TypeTown) + population = max(population, 10000); + else if (types.m_types[i] == m_TypeCity) + population = max(population, 100000); + else if (types.m_types[i] == m_TypeCityCapital) + population = max(population, 1000000); + else if (types.m_types[i] == m_TypeCountry) + population = max(population, 2000000); + else if (types.m_types[i] == m_TypeContinent) + population = max(population, 20000000); + } + return static_cast<uint8_t>(log(double(population)) / log(1.1)); } |