1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-24 20:54:08 +01:00

Codechange: Use EnumBitSet for LandscapeTypes and remove LandscapeID. (#13436)

This commit is contained in:
Peter Nelson
2025-02-01 23:09:18 +00:00
committed by GitHub
parent 9ff485b329
commit 59354576d4
49 changed files with 521 additions and 503 deletions

View File

@@ -24,10 +24,10 @@ public:
*/
enum LandscapeType {
/* Note: these values represent part of the in-game LandscapeType enum */
LT_TEMPERATE = ::LT_TEMPERATE, ///< Temperate climate.
LT_ARCTIC = ::LT_ARCTIC, ///< Arctic climate.
LT_TROPIC = ::LT_TROPIC, ///< Tropic climate.
LT_TOYLAND = ::LT_TOYLAND, ///< Toyland climate.
LT_TEMPERATE = to_underlying(::LandscapeType::Temperate), ///< Temperate climate.
LT_ARCTIC = to_underlying(::LandscapeType::Arctic), ///< Arctic climate.
LT_TROPIC = to_underlying(::LandscapeType::Tropic), ///< Tropic climate.
LT_TOYLAND = to_underlying(::LandscapeType::Toyland), ///< Toyland climate.
};
/**

View File

@@ -45,7 +45,7 @@
{
if (!IsValidIndustryType(industry_type)) return false;
if (_settings_game.game_creation.landscape != LT_TEMPERATE) return true;
if (_settings_game.game_creation.landscape != LandscapeType::Temperate) return true;
return (::GetIndustrySpec(industry_type)->behaviour & INDUSTRYBEH_DONT_INCR_PROD) == 0;
}