From 58b0cf61abc0074102658116aa2e0e601b9f8880 Mon Sep 17 00:00:00 2001 From: kobewi Date: Wed, 19 Mar 2025 00:34:05 +0100 Subject: [PATCH] Fix non-tool script check when emitting signals --- core/object/object.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/core/object/object.cpp b/core/object/object.cpp index 10bd258b707..5f091201a75 100644 --- a/core/object/object.cpp +++ b/core/object/object.cpp @@ -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