aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/military/Unit.cpp
diff options
context:
space:
mode:
author zaaarf <80046572+zaaarf@users.noreply.github.com>2023-12-05 22:53:07 +0100
committer GitHub <noreply@github.com>2023-12-05 22:53:07 +0100
commit48a3f1729d709847d7cad33f594c77cac414e802 (patch)
treed890ed3ca182a960a35e5d1edae16e32e7f2b836 /src/openvic-simulation/military/Unit.cpp
parentdb00dcfb8c72448fea73e752e1f5c18047738876 (diff)
parentfa2ca50905f327713207069cf9a2e66cf6c00076 (diff)
Merge pull request #83 from OpenVicProject/dataloading-inventions
Dataloading inventions
Diffstat (limited to 'src/openvic-simulation/military/Unit.cpp')
-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