Skip to content

Commit

Permalink
Merge pull request #1847 from ineveraskedforthis/economy-tweaking
Browse files Browse the repository at this point in the history
sanitise usage of global_immigrant_attract
  • Loading branch information
schombert authored Jan 7, 2025
2 parents 39294cd + c3d4f9f commit c282a7a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/economy/demographics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3416,10 +3416,10 @@ dcon::nation_id get_immigration_target(sys::state& state, dcon::nation_id owner,
float interp_result = trigger::evaluate_multiplicative_modifier(state, modifier, trigger::to_generic(inner), trigger::to_generic(p), 0);
assert( llvm_result == interp_result);
#endif
weight = std::max(0.0f, llvm_result * (state.world.nation_get_modifier_values(inner, sys::national_mod_offsets::global_immigrant_attract) + 1.0f));
weight = std::max(0.0f, llvm_result * std::max(0.f, (state.world.nation_get_modifier_values(inner, sys::national_mod_offsets::global_immigrant_attract) + 1.0f)));
} else {
float interp_result = trigger::evaluate_multiplicative_modifier(state, modifier, trigger::to_generic(inner), trigger::to_generic(p), 0);
weight = std::max(0.0f, interp_result * (state.world.nation_get_modifier_values(inner, sys::national_mod_offsets::global_immigrant_attract) + 1.0f));
weight = std::max(0.0f, interp_result * std::max(0.f, (state.world.nation_get_modifier_values(inner, sys::national_mod_offsets::global_immigrant_attract) + 1.0f)));
}

if(weight > top_weights[2]) {
Expand Down

0 comments on commit c282a7a

Please sign in to comment.