Fix inversed check inside register_singleton
This commit is contained in:
parent
30cf49e8d0
commit
dbb37e586b
1 changed files with 1 additions and 1 deletions
|
@ -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) {
|
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(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;
|
::Engine::Singleton s;
|
||||||
s.class_name = p_name;
|
s.class_name = p_name;
|
||||||
s.name = p_name;
|
s.name = p_name;
|
||||||
|
|
Loading…
Reference in a new issue