diff options
author | hop311 <hop3114@gmail.com> | 2023-12-02 16:48:08 +0100 |
---|---|---|
committer | hop311 <hop3114@gmail.com> | 2023-12-02 20:14:29 +0100 |
commit | 4a899c1a9e83ab9476b85522751081be434caa35 (patch) | |
tree | f1f6276c91beceecdfd9b09083d1c91ea8b41b60 /src/openvic-simulation/politics/Government.cpp | |
parent | cd6875d5e0ca5e2545fd0e1647678cd18a6c81c2 (diff) |
Crime+event modifier loading + misc UI backend
Diffstat (limited to 'src/openvic-simulation/politics/Government.cpp')
-rw-r--r-- | src/openvic-simulation/politics/Government.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/openvic-simulation/politics/Government.cpp b/src/openvic-simulation/politics/Government.cpp index 0d1d063..609e75f 100644 --- a/src/openvic-simulation/politics/Government.cpp +++ b/src/openvic-simulation/politics/Government.cpp @@ -37,9 +37,16 @@ bool GovernmentTypeManager::add_government_type( return false; } - return government_types.add_item({ + const bool ret = government_types.add_item({ identifier, std::move(ideologies), elections, appoint_ruling_party, term_duration, flag_type }); + + /* flag_type can be empty here for default/non-ideological flag */ + if (ret && std::find(flag_types.begin(), flag_types.end(), flag_type) == flag_types.end()) { + flag_types.emplace_back(flag_type); + } + + return ret; } /* REQUIREMENTS: FS-525, SIM-27 */ @@ -49,7 +56,7 @@ bool GovernmentTypeManager::load_government_types_file(IdeologyManager const& id std::vector<Ideology const*> ideologies; bool elections = false, appoint_ruling_party = false; Timespan term_duration = 0; - std::string_view flag_type_identifier = "republic"; + std::string_view flag_type_identifier; size_t total_expected_ideologies = 0; bool ret = expect_dictionary_keys_and_default( |