Fix inversed check inside register_singleton

This commit is contained in:
Hennadii Chernyshchyk 2021-09-28 00:17:31 +03:00
parent 30cf49e8d0
commit dbb37e586b
No known key found for this signature in database
GPG Key ID: 24623302B8395825

View File

@ -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;