diff options
author | Juan Linietsky <reduzio@gmail.com> | 2018-11-27 19:55:37 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2018-11-27 19:55:37 -0300 |
commit | 3a93499f899c68db38b68239f227e381e5ded20e (patch) | |
tree | 609de32458bc898c34c08f5996862bbac49ca903 /core/object.cpp | |
parent | 616b91b498b332c5cace5ed8324eb818d7eb68d2 (diff) | |
download | redot-engine-3a93499f899c68db38b68239f227e381e5ded20e.tar.gz |
Allow signal connecting even if script is invalid (only when compiled with tools), fixes #17070
Diffstat (limited to 'core/object.cpp')
-rw-r--r-- | core/object.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/core/object.cpp b/core/object.cpp index ea77090a45..3a14c7c0b5 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -1443,8 +1443,20 @@ Error Object::connect(const StringName &p_signal, Object *p_to_object, const Str if (!s) { bool signal_is_valid = ClassDB::has_signal(get_class_name(), p_signal); //check in script - if (!signal_is_valid && !script.is_null() && Ref<Script>(script)->has_script_signal(p_signal)) - signal_is_valid = true; + if (!signal_is_valid && !script.is_null()) { + + if (Ref<Script>(script)->has_script_signal(p_signal)) { + signal_is_valid = true; + } +#ifdef TOOLS_ENABLED + else { + //allow connecting signals anyway if script is invalid, see issue #17070 + if (!Ref<Script>(script)->is_valid()) { + signal_is_valid = true; + } + } +#endif + } if (!signal_is_valid) { ERR_EXPLAIN("In Object of type '" + String(get_class()) + "': Attempt to connect nonexistent signal '" + p_signal + "' to method '" + p_to_object->get_class() + "." + p_to_method + "'"); |