Merge pull request #86704 from AThousandShips/len_fix

[GDScript] Add `StringName` support to `@GDScript.len`
This commit is contained in:
Rémi Verschelde 2024-01-02 15:09:09 +01:00
commit 06bb9f28e7
No known key found for this signature in database
GPG key ID: C3336907360768E1
2 changed files with 3 additions and 2 deletions

View file

@ -470,7 +470,8 @@ struct GDScriptUtilityFunctionsDefinitions {
static inline void len(Variant *r_ret, const Variant **p_args, int p_arg_count, Callable::CallError &r_error) {
VALIDATE_ARG_COUNT(1);
switch (p_args[0]->get_type()) {
case Variant::STRING: {
case Variant::STRING:
case Variant::STRING_NAME: {
String d = *p_args[0];
*r_ret = d.length();
} break;