Skip to content

Commit 096f028

Browse files
committed
Fix Error when connecting signal with unbinds not yet existing function
When a Signal with unbinds was connected to a non-existing function, the connection attempt was made before the function was created. I moved the creation of the function in front of the connection attempt.
1 parent 0dd9178 commit 096f028

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

editor/scene/connections_dialog.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,13 +1001,6 @@ void ConnectionsDock::_make_or_edit_connection() {
10011001
}
10021002
}
10031003

1004-
if (connect_dialog->is_editing()) {
1005-
_disconnect(connect_dialog->get_source_connection_data());
1006-
_connect(cd);
1007-
} else {
1008-
_connect(cd);
1009-
}
1010-
10111004
if (add_script_function_request) {
10121005
PackedStringArray script_function_args = connect_dialog->get_signal_args();
10131006
script_function_args.resize(script_function_args.size() - cd.unbinds);
@@ -1057,6 +1050,13 @@ void ConnectionsDock::_make_or_edit_connection() {
10571050
EditorNode::get_singleton()->emit_signal(SNAME("script_add_function_request"), target, cd.method, script_function_args);
10581051
}
10591052

1053+
if (connect_dialog->is_editing()) {
1054+
_disconnect(connect_dialog->get_source_connection_data());
1055+
_connect(cd);
1056+
} else {
1057+
_connect(cd);
1058+
}
1059+
10601060
update_tree();
10611061
}
10621062

0 commit comments

Comments
 (0)