aboutsummaryrefslogtreecommitdiff
path: root/extension/src/openvic-extension/singletons/MenuSingleton.cpp
diff options
context:
space:
mode:
author wvpm <24685035+wvpm@users.noreply.github.com>2024-11-01 16:58:43 +0100
committer GitHub <noreply@github.com>2024-11-01 16:58:43 +0100
commita866c4bad4119a420dbf6ebb117f3efc001503ef (patch)
treeb4f65a01c830f7e7c7cc10385a0442bfa05264a9 /extension/src/openvic-extension/singletons/MenuSingleton.cpp
parent2558a8fb10eb2f6adc01653bc0d4da73141efb67 (diff)
parenta1a9d2d6ce3c94bccf224efcffd4c7e11eebe1e1 (diff)
Merge pull request #282 from OpenVicProject/fix_ui_binding_after_rgo_pr
Fix UI bindings after RGO PR
Diffstat (limited to 'extension/src/openvic-extension/singletons/MenuSingleton.cpp')
-rw-r--r--extension/src/openvic-extension/singletons/MenuSingleton.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/extension/src/openvic-extension/singletons/MenuSingleton.cpp b/extension/src/openvic-extension/singletons/MenuSingleton.cpp
index 8d7f9fe..cabe82b 100644
--- a/extension/src/openvic-extension/singletons/MenuSingleton.cpp
+++ b/extension/src/openvic-extension/singletons/MenuSingleton.cpp
@@ -2,8 +2,10 @@
#include <godot_cpp/variant/utility_functions.hpp>
+#include <openvic-simulation/economy/GoodDefinition.hpp>
#include <openvic-simulation/GameManager.hpp>
#include <openvic-simulation/modifier/Modifier.hpp>
+#include <openvic-simulation/types/fixed_point/FixedPoint.hpp>
#include "openvic-extension/classes/GFXPieChartTexture.hpp"
#include "openvic-extension/classes/GUINode.hpp"
@@ -472,10 +474,10 @@ Dictionary MenuSingleton::get_province_info_from_index(int32_t index) const {
ret[province_info_controller_key] = Utilities::std_to_godot_string(controller->get_identifier());
}
- GoodDefinition const* rgo = province->get_rgo();
- if (rgo != nullptr) {
- ret[province_info_rgo_name_key] = Utilities::std_to_godot_string(rgo->get_identifier());
- ret[province_info_rgo_icon_key] = static_cast<int32_t>(rgo->get_index());
+ GoodDefinition const* const rgo_good = province->get_rgo_good();
+ if (rgo_good != nullptr) {
+ ret[province_info_rgo_name_key] = Utilities::std_to_godot_string(rgo_good->get_identifier());
+ ret[province_info_rgo_icon_key] = static_cast<int32_t>(rgo_good->get_index());
}
Crime const* crime = province->get_crime();