aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/military/Unit.cpp
diff options
context:
space:
mode:
author zaaarf <me@zaaarf.foo>2023-12-05 10:16:27 +0100
committer zaaarf <me@zaaarf.foo>2023-12-05 10:16:27 +0100
commitfa2ca50905f327713207069cf9a2e66cf6c00076 (patch)
treea6c82c543d5fc52183ca1363e171dbd4cc161943 /src/openvic-simulation/military/Unit.cpp
parent444a27726695478e44e0166e75df1f354b6432d5 (diff)
feat: implemented invention dataloading
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