diff options
author | wvpm <24685035+wvpm@users.noreply.github.com> | 2024-01-31 20:08:49 +0100 |
---|---|---|
committer | wvpm <24685035+wvpm@users.noreply.github.com> | 2024-02-09 10:19:40 +0100 |
commit | e25653b2ca360ee25a655427277c816a8eb7b537 (patch) | |
tree | d87e27b55411a5b0319c38e62a98b9e5b2de1842 /src/openvic-simulation/pop | |
parent | f0fb01337d68a00147f582d04231b347cc1c8424 (diff) |
draft for factory productionfactory_turn
Diffstat (limited to 'src/openvic-simulation/pop')
-rw-r--r-- | src/openvic-simulation/pop/Pop.cpp | 4 | ||||
-rw-r--r-- | src/openvic-simulation/pop/Pop.hpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/openvic-simulation/pop/Pop.cpp b/src/openvic-simulation/pop/Pop.cpp index 1701321..536459d 100644 --- a/src/openvic-simulation/pop/Pop.cpp +++ b/src/openvic-simulation/pop/Pop.cpp @@ -533,8 +533,8 @@ bool PopManager::load_pop_into_vector( *non_integer_size = true; } - if (culture != nullptr && religion != nullptr && size >= 1) { - vec.emplace_back(Pop { type, *culture, *religion, size.to_int64_t(), militancy, consciousness, rebel_type }); + if (culture != nullptr && religion != nullptr && size >= 1 && size <= std::numeric_limits<Pop::pop_size_t>::max()) { + vec.emplace_back(Pop { type, *culture, *religion, size.to_int32_t(), militancy, consciousness, rebel_type }); } else { Logger::warning( "Some pop arguments are invalid: culture = ", culture, ", religion = ", religion, ", size = ", size diff --git a/src/openvic-simulation/pop/Pop.hpp b/src/openvic-simulation/pop/Pop.hpp index cdecf44..647d06d 100644 --- a/src/openvic-simulation/pop/Pop.hpp +++ b/src/openvic-simulation/pop/Pop.hpp @@ -30,7 +30,7 @@ namespace OpenVic { struct Pop { friend struct PopManager; - using pop_size_t = int64_t; + using pop_size_t = int32_t; static constexpr pop_size_t MAX_SIZE = std::numeric_limits<pop_size_t>::max(); |