diff --git a/extension/deps/openvic-simulation b/extension/deps/openvic-simulation index d6b9312f..04c8a63b 160000 --- a/extension/deps/openvic-simulation +++ b/extension/deps/openvic-simulation @@ -1 +1 @@ -Subproject commit d6b9312f534e9b45cf9a8cfbea981cf8cc938904 +Subproject commit 04c8a63b24b847eba47082e1c78c553c3f528332 diff --git a/extension/src/openvic-extension/components/overview/ScoreOverview.cpp b/extension/src/openvic-extension/components/overview/ScoreOverview.cpp index 6a4ceeb7..f358c571 100644 --- a/extension/src/openvic-extension/components/overview/ScoreOverview.cpp +++ b/extension/src/openvic-extension/components/overview/ScoreOverview.cpp @@ -218,7 +218,7 @@ godot::String ScoreOverview::generate_industrial_tooltip(CountryInstance& countr std::vector> industrial_power_states; for (auto const& [state, power] : country.get_industrial_power_from_states()) { industrial_power_states.emplace_back( - Utilities::get_state_name(industrial_score_label, *state), + Utilities::get_state_name(industrial_score_label, state), power ); } @@ -242,10 +242,11 @@ godot::String ScoreOverview::generate_industrial_tooltip(CountryInstance& countr // Tuple: Country identifier / Country name / Power std::vector> industrial_power_from_investments; - for (auto const& [country, power] : country.get_industrial_power_from_investments()) { + for (auto const& [investor_ref, power] : country.get_industrial_power_from_investments()) { + CountryInstance const& investor = investor_ref.get(); industrial_power_from_investments.emplace_back( - convert_to(country->get_identifier()), - Utilities::get_country_name(industrial_score_label, *country), + convert_to(investor.get_identifier()), + Utilities::get_country_name(industrial_score_label, investor), power ); } diff --git a/extension/src/openvic-extension/singletons/GameSingleton.cpp b/extension/src/openvic-extension/singletons/GameSingleton.cpp index 98a9d333..94818988 100644 --- a/extension/src/openvic-extension/singletons/GameSingleton.cpp +++ b/extension/src/openvic-extension/singletons/GameSingleton.cpp @@ -179,11 +179,7 @@ TypedArray GameSingleton::get_mod_info() const { return result; }(); - mod_info_dictionary[is_loaded_key] = ranges::contains( - loaded_mods, - mod, - [](Mod const& x) -> decltype(auto) { return x; } - ); + mod_info_dictionary[is_loaded_key] = ranges::contains(loaded_mods, mod); results.push_back(std::move(mod_info_dictionary)); } diff --git a/extension/src/openvic-extension/singletons/MenuSingleton.cpp b/extension/src/openvic-extension/singletons/MenuSingleton.cpp index dc73dc18..3b3bf301 100644 --- a/extension/src/openvic-extension/singletons/MenuSingleton.cpp +++ b/extension/src/openvic-extension/singletons/MenuSingleton.cpp @@ -959,13 +959,13 @@ String MenuSingleton::get_province_building_identifier(int32_t building_index) c GameSingleton const* game_singleton = GameSingleton::get_singleton(); ERR_FAIL_NULL_V(game_singleton, {}); - std::span province_building_types = game_singleton->get_definition_manager() + const forwardable_span> province_building_types = game_singleton->get_definition_manager() .get_economy_manager().get_building_type_manager().get_province_building_types(); ERR_FAIL_COND_V_MSG( building_index < 0 || building_index >= province_building_types.size(), {}, Utilities::format("Invalid province building index: %d", building_index) ); - return convert_to(province_building_types[building_index]->get_identifier()); + return convert_to(province_building_types[building_index].get().get_identifier()); } int32_t MenuSingleton::get_slave_pop_icon_index() const { diff --git a/extension/src/openvic-extension/singletons/TradeMenu.cpp b/extension/src/openvic-extension/singletons/TradeMenu.cpp index 18b3fc00..4a6aafe2 100644 --- a/extension/src/openvic-extension/singletons/TradeMenu.cpp +++ b/extension/src/openvic-extension/singletons/TradeMenu.cpp @@ -38,8 +38,8 @@ Dictionary MenuSingleton::get_trade_menu_good_categories_info() const { for (GoodCategory const& good_category : good_definition_manager.get_good_categories()) { TypedArray array; - for (GoodDefinition const* good_definition : good_category.get_good_definitions()) { - GoodInstance const& good_instance = good_instance_manager.get_good_instance_by_definition(*good_definition); + for (GoodDefinition const& good_definition : good_category.get_good_definitions()) { + GoodInstance const& good_instance = good_instance_manager.get_good_instance_by_definition(good_definition); if (!good_instance.is_trading_good()) { continue; @@ -47,7 +47,7 @@ Dictionary MenuSingleton::get_trade_menu_good_categories_info() const { Dictionary good_dict; - good_dict[good_index_key] = static_cast(type_safe::get(good_definition->index)); + good_dict[good_index_key] = static_cast(type_safe::get(good_definition.index)); good_dict[current_price_key] = static_cast(good_instance.get_price()); good_dict[price_change_key] = static_cast(good_instance.get_price_change_yesterday());