From a8d1e28de1dab36a407ea540e2d1393bc2478d15 Mon Sep 17 00:00:00 2001 From: wvpm <24685035+wvpm@users.noreply.github.com> Date: Sun, 22 Sep 2024 14:24:52 +0200 Subject: Link trade_goods in history to RGO instance for province. --- src/openvic-simulation/economy/production/ProductionType.cpp | 6 +++--- .../economy/production/ResourceGatheringOperation.hpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/openvic-simulation/economy/production') diff --git a/src/openvic-simulation/economy/production/ProductionType.cpp b/src/openvic-simulation/economy/production/ProductionType.cpp index bc5bc0b..fd9bce7 100644 --- a/src/openvic-simulation/economy/production/ProductionType.cpp +++ b/src/openvic-simulation/economy/production/ProductionType.cpp @@ -174,15 +174,15 @@ bool ProductionTypeManager::add_production_type( base_output_quantity, std::move(bonuses), std::move(maintenance_requirements), is_coastal, is_farm, is_mine }); - if(ret && (is_farm | is_mine)) { + if(ret && (template_type == RGO)) { ProductionType const& production_type = production_types.get_items().back(); auto current_rgo_pt = good_to_rgo_production_type[*output_good]; if(current_rgo_pt == nullptr) { // first rgo pt good_to_rgo_production_type[*output_good] = &production_type; } - else if (is_farm && current_rgo_pt->is_mine()) { - // farms are preferred over mines in V2 + else if (is_farm && !current_rgo_pt->is_farm()) { + // farms are preferred (over mines) in V2 good_to_rgo_production_type[*output_good] = &production_type; } //else ignore, we already have an rgo pt diff --git a/src/openvic-simulation/economy/production/ResourceGatheringOperation.hpp b/src/openvic-simulation/economy/production/ResourceGatheringOperation.hpp index 7528d6d..2fb782e 100644 --- a/src/openvic-simulation/economy/production/ResourceGatheringOperation.hpp +++ b/src/openvic-simulation/economy/production/ResourceGatheringOperation.hpp @@ -5,9 +5,9 @@ #include "openvic-simulation/utility/Getters.hpp" namespace OpenVic { - class ResourceGatheringOperation final { + struct ResourceGatheringOperation { private: - ProductionType const* PROPERTY_RW_ACCESS(production_type, public); + ProductionType const* PROPERTY_RW(production_type); fixed_point_t PROPERTY(revenue_yesterday); fixed_point_t PROPERTY(output_quantity_yesterday); fixed_point_t PROPERTY(unsold_quantity_yesterday); -- cgit v1.2.3-56-ga3b1