1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

OpenXR: fix casts and loop in action map editor

This commit replaces potentially unsafe static casts with
Object::cast_to and fixes the order in which UI elements are looped over
when removing controls. This fixes crashes and wrong data being
displayed in the OpenXR action map editor when saving or resetting
action maps.
This commit is contained in:
rsjtdrjgfuzkfg
2022-12-15 20:28:20 +01:00
parent 47ef0549ee
commit 20c192cc2d
4 changed files with 10 additions and 10 deletions

View File

@@ -46,7 +46,7 @@ void OpenXRSelectInteractionProfileDialog::_notification(int p_what) {
void OpenXRSelectInteractionProfileDialog::_on_select_interaction_profile(const String p_interaction_profile) {
if (selected_interaction_profile != "") {
NodePath button_path = ip_buttons[selected_interaction_profile];
Button *button = static_cast<Button *>(get_node(button_path));
Button *button = Object::cast_to<Button>(get_node(button_path));
if (button != nullptr) {
button->set_flat(true);
}
@@ -56,7 +56,7 @@ void OpenXRSelectInteractionProfileDialog::_on_select_interaction_profile(const
if (selected_interaction_profile != "") {
NodePath button_path = ip_buttons[selected_interaction_profile];
Button *button = static_cast<Button *>(get_node(button_path));
Button *button = Object::cast_to<Button>(get_node(button_path));
if (button != nullptr) {
button->set_flat(false);
}