From 1e714f86e40a72a0452b6a5c9148b6034e17b5a6 Mon Sep 17 00:00:00 2001 From: wvpm <24685035+wvpm@users.noreply.github.com> Date: Mon, 28 Oct 2024 15:11:51 +0100 Subject: Provinces contribute modifiers to controller, not owner --- src/openvic-simulation/country/CountryInstance.cpp | 2 +- src/openvic-simulation/map/ProvinceInstance.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/openvic-simulation') diff --git a/src/openvic-simulation/country/CountryInstance.cpp b/src/openvic-simulation/country/CountryInstance.cpp index 6e998e4..043494d 100644 --- a/src/openvic-simulation/country/CountryInstance.cpp +++ b/src/openvic-simulation/country/CountryInstance.cpp @@ -1011,7 +1011,7 @@ void CountryInstance::update_modifier_sum(Date today, StaticModifierCache const& if constexpr (ProvinceInstance::ADD_OWNER_CONTRIBUTION) { // Add province base modifiers (with local province modifier effects removed) - for (ProvinceInstance const* province : owned_provinces) { + for (ProvinceInstance const* province : controlled_provinces) { contribute_province_modifier_sum(province->get_modifier_sum()); } diff --git a/src/openvic-simulation/map/ProvinceInstance.cpp b/src/openvic-simulation/map/ProvinceInstance.cpp index 5bc798d..cbb23bd 100644 --- a/src/openvic-simulation/map/ProvinceInstance.cpp +++ b/src/openvic-simulation/map/ProvinceInstance.cpp @@ -238,8 +238,8 @@ void ProvinceInstance::update_modifier_sum(Date today, StaticModifierCache const modifier_sum.add_modifier_nullcheck(terrain_type, province_source); if constexpr (!ADD_OWNER_CONTRIBUTION) { - if (owner != nullptr) { - owner->contribute_province_modifier_sum(modifier_sum); + if (controller != nullptr) { + controller->contribute_province_modifier_sum(modifier_sum); } } } -- cgit v1.2.3-56-ga3b1