aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/country/CountryInstance.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/openvic-simulation/country/CountryInstance.cpp')
-rw-r--r--src/openvic-simulation/country/CountryInstance.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/openvic-simulation/country/CountryInstance.cpp b/src/openvic-simulation/country/CountryInstance.cpp
index 043494d..ea9596f 100644
--- a/src/openvic-simulation/country/CountryInstance.cpp
+++ b/src/openvic-simulation/country/CountryInstance.cpp
@@ -18,6 +18,9 @@ using enum CountryInstance::country_status_t;
static constexpr colour_t ERROR_COLOUR = colour_t::from_integer(0xFF0000);
CountryInstance::CountryInstance(
+#if OV_MODIFIER_CALCULATION_TEST
+ bool new_ADD_OWNER_CONTRIBUTION,
+#endif
CountryDefinition const* new_country_definition,
decltype(building_type_unlock_levels)::keys_t const& building_type_keys,
decltype(technology_unlock_levels)::keys_t const& technology_keys,
@@ -30,6 +33,9 @@ CountryInstance::CountryInstance(
decltype(regiment_type_unlock_levels)::keys_t const& regiment_type_unlock_levels_keys,
decltype(ship_type_unlock_levels)::keys_t const& ship_type_unlock_levels_keys
) : /* Main attributes */
+#if OV_MODIFIER_CALCULATION_TEST
+ ADD_OWNER_CONTRIBUTION { new_ADD_OWNER_CONTRIBUTION },
+#endif
country_definition { new_country_definition },
colour { ERROR_COLOUR },
capital { nullptr },
@@ -1009,7 +1015,11 @@ void CountryInstance::update_modifier_sum(Date today, StaticModifierCache const&
}
}
+#if OV_MODIFIER_CALCULATION_TEST
+ if (ADD_OWNER_CONTRIBUTION) {
+#else
if constexpr (ProvinceInstance::ADD_OWNER_CONTRIBUTION) {
+#endif
// Add province base modifiers (with local province modifier effects removed)
for (ProvinceInstance const* province : controlled_provinces) {
contribute_province_modifier_sum(province->get_modifier_sum());
@@ -1219,6 +1229,9 @@ CountryInstance const& CountryInstanceManager::get_country_instance_from_definit
}
bool CountryInstanceManager::generate_country_instances(
+#if OV_MODIFIER_CALCULATION_TEST
+ bool ADD_OWNER_CONTRIBUTION,
+#endif
CountryDefinitionManager const& country_definition_manager,
decltype(CountryInstance::building_type_unlock_levels)::keys_t const& building_type_keys,
decltype(CountryInstance::technology_unlock_levels)::keys_t const& technology_keys,
@@ -1237,6 +1250,9 @@ bool CountryInstanceManager::generate_country_instances(
for (CountryDefinition const& country_definition : country_definition_manager.get_country_definitions()) {
ret &= country_instances.add_item({
+#if OV_MODIFIER_CALCULATION_TEST
+ ADD_OWNER_CONTRIBUTION,
+#endif
&country_definition,
building_type_keys,
technology_keys,