diff options
author | wvpm <24685035+wvpm@users.noreply.github.com> | 2024-10-31 20:44:49 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-31 20:44:49 +0100 |
commit | c6f7c8047abbe0a91b2a88365eee2259d8a91a65 (patch) | |
tree | c8c1c67b0006c65541b4f9d8897e8b9137f5346c /src/openvic-simulation/economy/production | |
parent | c763a0aedd834432b54b6e49c6bc7e1936be1131 (diff) | |
parent | 2cebd422b1f34d5f82e0576afcf786c9b5c57271 (diff) |
Merge pull request #221 from OpenVicProject/correct_rgo_size
Correct rgo size calcuation
Diffstat (limited to 'src/openvic-simulation/economy/production')
-rw-r--r-- | src/openvic-simulation/economy/production/ResourceGatheringOperation.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/openvic-simulation/economy/production/ResourceGatheringOperation.cpp b/src/openvic-simulation/economy/production/ResourceGatheringOperation.cpp index df91645..70cb64d 100644 --- a/src/openvic-simulation/economy/production/ResourceGatheringOperation.cpp +++ b/src/openvic-simulation/economy/production/ResourceGatheringOperation.cpp @@ -83,12 +83,20 @@ Pop::pop_size_t ResourceGatheringOperation::update_size_and_return_total_worker_ } } } + + fixed_point_t base_size_modifier = fixed_point_t::_1(); + if (production_type.is_farm()) { + base_size_modifier += location.get_modifier_effect_value_nullcheck(modifier_effect_cache.get_farm_rgo_size_local()); + } + if (production_type.is_mine()) { + base_size_modifier += location.get_modifier_effect_value_nullcheck(modifier_effect_cache.get_mine_rgo_size_local()); + } const fixed_point_t base_workforce_size = production_type.get_base_workforce_size(); - if (size_modifier == fixed_point_t::_0()) { + if (base_size_modifier == fixed_point_t::_0()) { size_multiplier = 0; } else { - size_multiplier = ((total_worker_count_in_province / (size_modifier * base_workforce_size)).ceil() * fixed_point_t::_1_50()).floor(); + size_multiplier = ((total_worker_count_in_province / (base_size_modifier * base_workforce_size)).ceil() * fixed_point_t::_1_50()).floor(); } max_employee_count_cache = (size_modifier * size_multiplier * base_workforce_size).floor(); return total_worker_count_in_province; |