diff options
author | rune-scape <allie.smith.epic@gmail.com> | 2023-12-28 14:44:23 -0800 |
---|---|---|
committer | rune-scape <spartacrafter@gmail.com> | 2024-08-29 13:39:27 -0700 |
commit | 154049ce1792a6e12b990e0a414a6c084c3b91c5 (patch) | |
tree | 102bda57c74f9efaa227c970255327f734043ce9 /scene/main/node.cpp | |
parent | 40b378e9e2338d84f897f6991cc913a713295785 (diff) | |
download | redot-engine-154049ce1792a6e12b990e0a414a6c084c3b91c5.tar.gz |
StringName Dictionary keys
also added 'is_string()' method to Variant
and refactored many String type comparisons to use it instead
Diffstat (limited to 'scene/main/node.cpp')
-rw-r--r-- | scene/main/node.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/scene/main/node.cpp b/scene/main/node.cpp index de6d49761b..50f5923e3c 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -770,8 +770,7 @@ Error Node::_rpc_bind(const Variant **p_args, int p_argcount, Callable::CallErro return ERR_INVALID_PARAMETER; } - Variant::Type type = p_args[0]->get_type(); - if (type != Variant::STRING_NAME && type != Variant::STRING) { + if (!p_args[0]->is_string()) { r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::STRING_NAME; @@ -799,8 +798,7 @@ Error Node::_rpc_id_bind(const Variant **p_args, int p_argcount, Callable::CallE return ERR_INVALID_PARAMETER; } - Variant::Type type = p_args[1]->get_type(); - if (type != Variant::STRING_NAME && type != Variant::STRING) { + if (!p_args[1]->is_string()) { r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 1; r_error.expected = Variant::STRING_NAME; @@ -3436,7 +3434,7 @@ Variant Node::_call_deferred_thread_group_bind(const Variant **p_args, int p_arg return Variant(); } - if (p_args[0]->get_type() != Variant::STRING_NAME && p_args[0]->get_type() != Variant::STRING) { + if (!p_args[0]->is_string()) { r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::STRING_NAME; @@ -3459,7 +3457,7 @@ Variant Node::_call_thread_safe_bind(const Variant **p_args, int p_argcount, Cal return Variant(); } - if (p_args[0]->get_type() != Variant::STRING_NAME && p_args[0]->get_type() != Variant::STRING) { + if (!p_args[0]->is_string()) { r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; r_error.expected = Variant::STRING_NAME; |