Skip to content

Commit

Permalink
Merge pull request schombert#1700 from Nivaturimika/fixesfdfdf
Browse files Browse the repository at this point in the history
fixes
  • Loading branch information
schombert authored Jul 8, 2024
2 parents dfc1994 + a5cd77c commit 335328b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/gamestate/modifiers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ namespace sys {
MOD_LIST_ELEMENT(76, non_accepted_pop_consciousness_modifier, true, modifier_display_type::fp_two_places, \
"modifier_non_accepted_pop_consciousness_modifier") \
MOD_LIST_ELEMENT(77, cb_generation_speed_modifier, true, modifier_display_type::percent, "cb_manufacture_tech") \
MOD_LIST_ELEMENT(78, mobilization_impact, false, modifier_display_type::percent, "modifier_mobilization_impact") \
MOD_LIST_ELEMENT(78, mobilization_impact, true, modifier_display_type::percent, "modifier_mobilization_impact") \
MOD_LIST_ELEMENT(79, suppression_points_modifier, true, modifier_display_type::percent, "suppression_tech") \
MOD_LIST_ELEMENT(80, education_efficiency_modifier, true, modifier_display_type::percent, "modifier_education_efficiency") \
MOD_LIST_ELEMENT(81, civilization_progress_modifier, true, modifier_display_type::percent, "modifier_civilization_progress") \
Expand Down
3 changes: 0 additions & 3 deletions src/gamestate/system_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1488,9 +1488,6 @@ void state::render() { // called to render the frame may (and should) delay retu
ui_state.under_mouse = mouse_probe.under_mouse;
ui_state.relative_mouse_location = mouse_probe.relative_location;
if(mode == sys::game_mode_type::in_game) {
if(ui_state.tl_chat_list) {
ui_state.root->move_child_to_front(ui_state.tl_chat_list);
}
if(map_state.get_zoom() > map::zoom_close) {
if(!ui_state.ctrl_held_down) {
if(ui_state.rgos_root && map_state.active_map_mode == map_mode::mode::rgo_output) {
Expand Down
6 changes: 5 additions & 1 deletion src/map/map_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ void update_text_lines(sys::state& state, display_data& map_data) {
name = text::resolve_string_substitution(state, "map_label_adj_province", sub);
} else {
for(const auto& e : map) {
if(float(e.second) / float(total_provinces) >= 0.75f) {
if(float(e.second) >= float(total_provinces) * 0.66f) {
// Adjective + " " + National identity
auto const nid = dcon::national_identity_id(dcon::national_identity_id::value_base_t(e.first));
if(auto k = state.world.national_identity_get_name(nid); state.key_is_localized(k)) {
Expand All @@ -401,6 +401,8 @@ void update_text_lines(sys::state& state, display_data& map_data) {
degrees = 360.f + degrees;
}
assert(degrees >= 0.f && degrees <= 360.f);
//fallback just in the very unlikely case
name = text::resolve_string_substitution(state, "map_label_adj_state", sub);
if(degrees >= 0.f && degrees < 90.f) {
name = text::resolve_string_substitution(state, "map_label_east_country", sub);
} else if(degrees >= 90.f && degrees < 180.f) {
Expand All @@ -410,6 +412,8 @@ void update_text_lines(sys::state& state, display_data& map_data) {
} else if(degrees >= 270.f && degrees < 360.f) {
name = text::resolve_string_substitution(state, "map_label_north_country", sub);
}
} else {
name = text::resolve_string_substitution(state, "map_label_adj_continent", sub);
}
} else {
text::add_to_substitution_map(sub, text::variable_type::tag, state.world.national_identity_get_name(nid));
Expand Down
7 changes: 3 additions & 4 deletions src/nations/nations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -976,7 +976,7 @@ void update_monthly_points(sys::state& state) {
state.world.execute_serial_over_nation([&](auto ids) {
auto pmod = state.world.nation_get_demographics(ids, demographics::consciousness) /
ve::max(state.world.nation_get_demographics(ids, demographics::total), 1.0f) * 0.0222f;
state.world.nation_set_plurality(ids, ve::min(state.world.nation_get_plurality(ids) + pmod, 100.0f));
state.world.nation_set_plurality(ids, ve::max(ve::min(state.world.nation_get_plurality(ids) + pmod, 100.0f), 0.f));
});
/*
- Monthly diplo-points: (1 + national-modifier-to-diplo-points + diplo-points-from-technology) x
Expand All @@ -986,7 +986,7 @@ void update_monthly_points(sys::state& state) {
auto bmod = state.world.nation_get_modifier_values(ids, sys::national_mod_offsets::diplomatic_points_modifier) + 1.0f;
auto dmod = bmod * state.defines.base_monthly_diplopoints;

state.world.nation_set_diplomatic_points(ids, ve::min(state.world.nation_get_diplomatic_points(ids) + dmod, 9.0f));
state.world.nation_set_diplomatic_points(ids, ve::max(ve::min(state.world.nation_get_diplomatic_points(ids) + dmod, 9.0f), 0.f));
});
/*
- Monthly suppression point gain: define:SUPPRESS_BUREAUCRAT_FACTOR x fraction-of-population-that-are-bureaucrats x
Expand All @@ -1000,8 +1000,7 @@ void update_monthly_points(sys::state& state) {
ve::max(state.world.nation_get_demographics(ids, demographics::total), 1.0f) *
state.defines.suppress_bureaucrat_factor);

state.world.nation_set_suppression_points(ids,
ve::min(state.world.nation_get_suppression_points(ids) + cmod, state.defines.max_suppression));
state.world.nation_set_suppression_points(ids, ve::max(ve::min(state.world.nation_get_suppression_points(ids) + cmod, state.defines.max_suppression), 0.f));
});
/*
- Monthly relations adjustment = +0.25 for subjects/overlords, -0.01 for being at war, +0.05 if adjacent and both are at
Expand Down

0 comments on commit 335328b

Please sign in to comment.