You've already forked godot
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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user