diff --git a/src/HOI4World/Map/StrategicRegions.cpp b/src/HOI4World/Map/StrategicRegions.cpp index 52f471ea2..4fc94b5d7 100644 --- a/src/HOI4World/Map/StrategicRegions.cpp +++ b/src/HOI4World/Map/StrategicRegions.cpp @@ -10,7 +10,7 @@ namespace { -[[no_discard]] std::map DetermineUsedRegions(const HoI4::State& state, +[[nodiscard]] std::map DetermineUsedRegions(const HoI4::State& state, const std::map& province_to_strategic_region_map) { std::map used_regions; // region ID -> number of provinces in that region @@ -30,11 +30,18 @@ namespace } } + // hack to make Novgorod a last-choice region to work around this hoi4 bug: + // https://forum.paradoxplaza.com/forum/threads/crash-due-to-some-strategic-regions.1619874/ + if (used_regions.contains(132)) + { + used_regions[132] = 1; + } + return used_regions; } -[[no_discard]] std::optional DetermineMostUsedRegion(const std::map& used_regions) +[[nodiscard]] std::optional DetermineMostUsedRegion(const std::map& used_regions) { if (!used_regions.empty()) { @@ -60,7 +67,7 @@ void AddProvinceToRegion(int region_number, int province_id, std::map DetermineAssignedProvinces(const std::map& strategic_regions) +[[nodiscard]] std::set DetermineAssignedProvinces(const std::map& strategic_regions) { std::set assigned_provinces; for (const HoI4::StrategicRegion& strategic_region: strategic_regions | std::ranges::views::values)