aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/military
diff options
context:
space:
mode:
Diffstat (limited to 'src/openvic-simulation/military')
-rw-r--r--src/openvic-simulation/military/Unit.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/openvic-simulation/military/Unit.cpp b/src/openvic-simulation/military/Unit.cpp
index 7995aeb..ed3d37b 100644
--- a/src/openvic-simulation/military/Unit.cpp
+++ b/src/openvic-simulation/military/Unit.cpp
@@ -191,12 +191,11 @@ bool UnitManager::load_unit_file(GoodManager const& good_manager, ast::NodeCPtr
}
#define STAT_MODIFIER(name, positive_good, format) \
- ret &= modifier_manager.add_modifier_effect(base_name + name, positive_good, ModifierEffect::format_t::format)
+ ret &= modifier_manager.add_modifier_effect(StringUtils::append_string_views(identifier, "_", name), positive_good, ModifierEffect::format_t::format)
bool UnitManager::generate_modifiers(ModifierManager& modifier_manager) {
std::function<bool(std::string_view, Unit::type_t)> generate_stat_modifiers = [this, &modifier_manager](std::string_view identifier, Unit::type_t type) -> bool {
modifier_manager.register_complex_modifier(identifier);
- std::string base_name = std::string(identifier) + "_";
bool ret = true;
STAT_MODIFIER("default_organisation", true, RAW_DECIMAL);
@@ -237,4 +236,6 @@ bool UnitManager::generate_modifiers(ModifierManager& modifier_manager) {
ret &= generate_stat_modifiers(unit.get_identifier(), unit.get_type());
return ret;
-} \ No newline at end of file
+}
+
+#undef STAT_MODIFIER \ No newline at end of file