aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/pop
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2024-10-31 20:29:34 +0100
committer hop311 <hop3114@gmail.com>2024-10-31 20:54:50 +0100
commitdbf58b1b1d318b4a82cf22b5b8e720c753388f4b (patch)
treed6d2be10697d6fa320f7f8da14eda45111bd9399 /src/openvic-simulation/pop
parentc763a0aedd834432b54b6e49c6bc7e1936be1131 (diff)
Load defines directly into named and typed variables rather than using an IdentifierRegistrydefines-variables
Diffstat (limited to 'src/openvic-simulation/pop')
-rw-r--r--src/openvic-simulation/pop/Pop.cpp8
1 files changed, 5 insertions, 3 deletions
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;
}
}