diff options
author | wvpm <24685035+wvpm@users.noreply.github.com> | 2024-09-22 14:24:52 +0200 |
---|---|---|
committer | wvpm <24685035+wvpm@users.noreply.github.com> | 2024-09-22 14:24:52 +0200 |
commit | a8d1e28de1dab36a407ea540e2d1393bc2478d15 (patch) | |
tree | 4386bf94d5cfe047b2863e48925805d78a2b6040 /src/openvic-simulation/economy | |
parent | 5a819de3019f8497dddae8e76d01f48cf8a86adb (diff) |
Link trade_goods in history to RGO instance for province.
Diffstat (limited to 'src/openvic-simulation/economy')
-rw-r--r-- | src/openvic-simulation/economy/production/ProductionType.cpp | 6 | ||||
-rw-r--r-- | src/openvic-simulation/economy/production/ResourceGatheringOperation.hpp | 4 |
2 files changed, 5 insertions, 5 deletions
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); |