From dbb37e586b73716148930b1939bfa4a9601eb2de Mon Sep 17 00:00:00 2001 From: Hennadii Chernyshchyk Date: Tue, 28 Sep 2021 00:17:31 +0300 Subject: [PATCH] Fix inversed check inside register_singleton --- core/core_bind.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/core_bind.cpp b/core/core_bind.cpp index 242a2f36388..71c04f7954a 100644 --- a/core/core_bind.cpp +++ b/core/core_bind.cpp @@ -2221,7 +2221,7 @@ Object *Engine::get_singleton_object(const StringName &p_name) const { void Engine::register_singleton(const StringName &p_name, Object *p_object) { ERR_FAIL_COND_MSG(has_singleton(p_name), "Singleton already registered: " + String(p_name)); - ERR_FAIL_COND_MSG(p_name.operator String().is_valid_identifier(), "Singleton name is not a valid identifier: " + String(p_name)); + ERR_FAIL_COND_MSG(!String(p_name).is_valid_identifier(), "Singleton name is not a valid identifier: " + p_name); ::Engine::Singleton s; s.class_name = p_name; s.name = p_name;