From dbf58b1b1d318b4a82cf22b5b8e720c753388f4b Mon Sep 17 00:00:00 2001 From: hop311 Date: Thu, 31 Oct 2024 19:29:34 +0000 Subject: Load defines directly into named and typed variables rather than using an IdentifierRegistry --- src/openvic-simulation/pop/Pop.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/openvic-simulation/pop/Pop.cpp') diff --git a/src/openvic-simulation/pop/Pop.cpp b/src/openvic-simulation/pop/Pop.cpp index 5780450..d92aa24 100644 --- a/src/openvic-simulation/pop/Pop.cpp +++ b/src/openvic-simulation/pop/Pop.cpp @@ -2,9 +2,9 @@ #include "openvic-simulation/country/CountryDefinition.hpp" #include "openvic-simulation/country/CountryInstance.hpp" +#include "openvic-simulation/defines/Define.hpp" #include "openvic-simulation/map/ProvinceInstance.hpp" #include "openvic-simulation/military/UnitType.hpp" -#include "openvic-simulation/misc/Define.hpp" #include "openvic-simulation/modifier/ModifierManager.hpp" #include "openvic-simulation/politics/Ideology.hpp" #include "openvic-simulation/politics/Issue.hpp" @@ -144,14 +144,16 @@ void Pop::update_gamestate( DefineManager const& define_manager, CountryInstance const* owner, const fixed_point_t pop_size_per_regiment_multiplier ) { if (type->get_can_be_recruited()) { + MilitaryDefines const& military_defines = define_manager.get_military_defines(); + if ( - size < define_manager.get_min_pop_size_for_regiment() || owner == nullptr || + size < military_defines.get_min_pop_size_for_regiment() || owner == nullptr || !RegimentType::allowed_cultures_check_culture_in_country(owner->get_allowed_regiment_cultures(), culture, *owner) ) { max_supported_regiments = 0; } else { max_supported_regiments = (fixed_point_t::parse(size) / ( - fixed_point_t::parse(define_manager.get_pop_size_per_regiment()) * pop_size_per_regiment_multiplier + fixed_point_t::parse(military_defines.get_pop_size_per_regiment()) * pop_size_per_regiment_multiplier )).to_int64_t() + 1; } } -- cgit v1.2.3-56-ga3b1