aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/pop/Pop.cpp
diff options
context:
space:
mode:
author wvpm <24685035+wvpm@users.noreply.github.com>2024-09-18 22:04:12 +0200
committer GitHub <noreply@github.com>2024-09-18 22:04:12 +0200
commitf0814926f675d6ecf889d8add410b1c37f625b29 (patch)
treea6875ab4102e978500cf5d4a438ebfd654bc5574 /src/openvic-simulation/pop/Pop.cpp
parent2069be1f1948a3b532536c640ff2baf80e9e1145 (diff)
parent837dfc73574f0328a0987f3f7b96641d39317369 (diff)
Merge pull request #199 from OpenVicProject/pop_size_int32
Reduce pop size to int32
Diffstat (limited to 'src/openvic-simulation/pop/Pop.cpp')
-rw-r--r--src/openvic-simulation/pop/Pop.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/openvic-simulation/pop/Pop.cpp b/src/openvic-simulation/pop/Pop.cpp
index 9221485..cde7013 100644
--- a/src/openvic-simulation/pop/Pop.cpp
+++ b/src/openvic-simulation/pop/Pop.cpp
@@ -642,8 +642,8 @@ bool PopManager::load_pop_bases_into_vector(
*non_integer_size = true;
}
- if (culture != nullptr && religion != nullptr && size >= 1) {
- vec.emplace_back(PopBase { 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(PopBase { 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