You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-12-30 18:30:54 +00:00
Fix non-tool script check when emitting signals
This commit is contained in:
@@ -1362,14 +1362,18 @@ Error Object::emit_signalp(const StringName &p_name, const Variant **p_args, int
|
||||
_emitting = false;
|
||||
|
||||
if (ce.error != Callable::CallError::CALL_OK) {
|
||||
Object *target = callable.get_object();
|
||||
#ifdef DEBUG_ENABLED
|
||||
if (flags & CONNECT_PERSIST && Engine::get_singleton()->is_editor_hint() && (!script_instance || !script_instance->get_script()->is_tool())) {
|
||||
continue;
|
||||
if (target && flags & CONNECT_PERSIST && Engine::get_singleton()->is_editor_hint()) {
|
||||
Ref<Script> other_scr = target->get_script();
|
||||
if (other_scr.is_valid() && !other_scr->is_tool()) {
|
||||
// Trying to call not-tool method in editor, just ignore it.
|
||||
continue;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Object *target = callable.get_object();
|
||||
if (ce.error == Callable::CallError::CALL_ERROR_INVALID_METHOD && target && !ClassDB::class_exists(target->get_class_name())) {
|
||||
//most likely object is not initialized yet, do not throw error.
|
||||
// Most likely object is not initialized yet, do not throw error.
|
||||
} else {
|
||||
ERR_PRINT(vformat("Error calling from signal '%s' to callable: %s.", String(p_name), Variant::get_callable_error_text(callable, args, argc, ce)));
|
||||
err = ERR_METHOD_NOT_FOUND;
|
||||
|
||||
Reference in New Issue
Block a user