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/scene_tree.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/scene_tree.cpp')
-rw-r--r-- | scene/main/scene_tree.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp index f0c9e8a866..106130872d 100644 --- a/scene/main/scene_tree.cpp +++ b/scene/main/scene_tree.cpp @@ -1315,8 +1315,8 @@ void SceneTree::_call_group_flags(const Variant **p_args, int p_argcount, Callab ERR_FAIL_COND(p_argcount < 3); ERR_FAIL_COND(!p_args[0]->is_num()); - ERR_FAIL_COND(p_args[1]->get_type() != Variant::STRING_NAME && p_args[1]->get_type() != Variant::STRING); - ERR_FAIL_COND(p_args[2]->get_type() != Variant::STRING_NAME && p_args[2]->get_type() != Variant::STRING); + ERR_FAIL_COND(!p_args[1]->is_string()); + ERR_FAIL_COND(!p_args[2]->is_string()); int flags = *p_args[0]; StringName group = *p_args[1]; @@ -1329,8 +1329,8 @@ void SceneTree::_call_group(const Variant **p_args, int p_argcount, Callable::Ca r_error.error = Callable::CallError::CALL_OK; ERR_FAIL_COND(p_argcount < 2); - ERR_FAIL_COND(p_args[0]->get_type() != Variant::STRING_NAME && p_args[0]->get_type() != Variant::STRING); - ERR_FAIL_COND(p_args[1]->get_type() != Variant::STRING_NAME && p_args[1]->get_type() != Variant::STRING); + ERR_FAIL_COND(!p_args[0]->is_string()); + ERR_FAIL_COND(!p_args[1]->is_string()); StringName group = *p_args[0]; StringName method = *p_args[1]; |