aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/military/LeaderTrait.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/openvic-simulation/military/LeaderTrait.cpp')
-rw-r--r--src/openvic-simulation/military/LeaderTrait.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/openvic-simulation/military/LeaderTrait.cpp b/src/openvic-simulation/military/LeaderTrait.cpp
index da7331a..7835636 100644
--- a/src/openvic-simulation/military/LeaderTrait.cpp
+++ b/src/openvic-simulation/military/LeaderTrait.cpp
@@ -1,5 +1,7 @@
#include "LeaderTrait.hpp"
+#include "openvic-simulation/modifier/ModifierManager.hpp"
+
using namespace OpenVic;
using namespace OpenVic::NodeTools;
@@ -30,17 +32,21 @@ bool LeaderTraitManager::load_leader_traits_file(ModifierManager const& modifier
return expect_dictionary_reserve_length(
leader_traits,
[this, &modifier_manager, type](std::string_view trait_identifier, ast::NodeCPtr value) -> bool {
+ using enum Modifier::modifier_type_t;
+
static const string_set_t allowed_modifiers = {
- "attack", "defence", "morale", "organisation", "reconnaissance",
+ "attack", "defence leader", "morale", "organisation", "reconnaissance",
"speed", "attrition", "experience", "reliability"
};
ModifierValue modifiers;
+
bool ret = modifier_manager.expect_whitelisted_modifier_value(
- move_variable_callback(modifiers), allowed_modifiers
+ move_variable_callback(modifiers), LEADER, allowed_modifiers
)(value);
ret &= add_leader_trait(trait_identifier, type, std::move(modifiers));
+
return ret;
}
);