diff options
4 files changed, 8 insertions, 5 deletions
diff --git a/src/openvic-simulation/military/UnitType.cpp b/src/openvic-simulation/military/UnitType.cpp index 920f28b..c185154 100644 --- a/src/openvic-simulation/military/UnitType.cpp +++ b/src/openvic-simulation/military/UnitType.cpp @@ -116,8 +116,8 @@ static bool _check_shared_parameters(std::string_view identifier, UnitType::unit return false; } - if (unit_args.icon <= 0) { - Logger::error("Invalid icon for unit ", identifier, " - ", unit_args.icon, " (must be positive)"); + if (unit_args.icon < 0) { + Logger::error("Invalid icon for unit ", identifier, " - ", unit_args.icon, " (must be >= 0)"); return false; } diff --git a/src/openvic-simulation/modifier/ModifierEffectCache.cpp b/src/openvic-simulation/modifier/ModifierEffectCache.cpp index 291ef9c..afb733a 100644 --- a/src/openvic-simulation/modifier/ModifierEffectCache.cpp +++ b/src/openvic-simulation/modifier/ModifierEffectCache.cpp @@ -197,6 +197,7 @@ ModifierEffectCache::ModifierEffectCache() local_rgo_throughput { nullptr }, local_ruling_party_support { nullptr }, local_ship_build { nullptr }, + attrition_local { nullptr }, max_attrition { nullptr }, mine_rgo_throughput_global { nullptr }, mine_rgo_output_global { nullptr }, @@ -214,7 +215,7 @@ ModifierEffectCache::ModifierEffectCache() /* Military Modifier Effects */ attack_leader { nullptr }, - attrition { nullptr }, + attrition_leader { nullptr }, defence_leader { nullptr }, experience { nullptr }, morale_global { nullptr }, diff --git a/src/openvic-simulation/modifier/ModifierEffectCache.hpp b/src/openvic-simulation/modifier/ModifierEffectCache.hpp index 9a0e9de..757eca0 100644 --- a/src/openvic-simulation/modifier/ModifierEffectCache.hpp +++ b/src/openvic-simulation/modifier/ModifierEffectCache.hpp @@ -167,6 +167,7 @@ namespace OpenVic { ModifierEffect const* PROPERTY(local_rgo_throughput); ModifierEffect const* PROPERTY(local_ruling_party_support); ModifierEffect const* PROPERTY(local_ship_build); + ModifierEffect const* PROPERTY(attrition_local); ModifierEffect const* PROPERTY(max_attrition); ModifierEffect const* PROPERTY(mine_rgo_throughput_global); ModifierEffect const* PROPERTY(mine_rgo_output_global); @@ -185,7 +186,7 @@ namespace OpenVic { /* Military Modifier Effects */ ModifierEffect const* PROPERTY(attack_leader); - ModifierEffect const* PROPERTY(attrition); + ModifierEffect const* PROPERTY(attrition_leader); ModifierEffect const* PROPERTY(defence_leader); ModifierEffect const* PROPERTY(experience); ModifierEffect const* PROPERTY(morale_leader); diff --git a/src/openvic-simulation/modifier/ModifierManager.cpp b/src/openvic-simulation/modifier/ModifierManager.cpp index 83e1756..a5ef8a8 100644 --- a/src/openvic-simulation/modifier/ModifierManager.cpp +++ b/src/openvic-simulation/modifier/ModifierManager.cpp @@ -488,6 +488,7 @@ bool ModifierManager::setup_modifier_effects() { ret &= register_base_province_modifier_effect( modifier_effect_cache.local_ship_build, "local_ship_build", false, PROPORTION_DECIMAL ); + ret &= register_terrain_modifier_effect(modifier_effect_cache.attrition_local, "attrition", false, PROPORTION_DECIMAL, "UA_ATTRITION"); ret &= register_base_province_modifier_effect(modifier_effect_cache.max_attrition, "max_attrition", false, RAW_DECIMAL); ret &= register_technology_modifier_effect( modifier_effect_cache.mine_rgo_throughput_global, "mine_rgo_eff", true, PROPORTION_DECIMAL, "TECH_MINE_OUTPUT" @@ -530,7 +531,7 @@ bool ModifierManager::setup_modifier_effects() { /* Military Modifier Effects */ ret &= register_leader_modifier_effect(modifier_effect_cache.attack_leader, "attack", true, INT, "TRAIT_ATTACK"); - ret &= register_leader_modifier_effect(modifier_effect_cache.attrition, "attrition", false, RAW_DECIMAL, "ATTRITION"); + ret &= register_leader_modifier_effect(modifier_effect_cache.attrition_leader, "attrition", false, RAW_DECIMAL, "ATTRITION"); ret &= register_leader_modifier_effect(modifier_effect_cache.defence_leader, "defence", true, INT, "TRAIT_DEFEND"); ret &= register_leader_modifier_effect( modifier_effect_cache.experience, "experience", true, PROPORTION_DECIMAL, "TRAIT_EXPERIENCE" |