diff --git a/core/variant.cpp b/core/variant.cpp index e4be5520bc5..9fa51ec7c91 100644 --- a/core/variant.cpp +++ b/core/variant.cpp @@ -1192,7 +1192,7 @@ Variant::operator int64_t() const { case BOOL: return _data._bool ? 1 : 0; case INT: return _data._int; case REAL: return _data._real; - case STRING: return operator String().to_int(); + case STRING: return operator String().to_int64(); default: { return 0; diff --git a/core/variant_call.cpp b/core/variant_call.cpp index 19308ff6834..b312316f9a8 100644 --- a/core/variant_call.cpp +++ b/core/variant_call.cpp @@ -1159,7 +1159,7 @@ Variant Variant::construct(const Variant::Type p_type, const Variant **p_args, i return Variant(bool(*p_args[0])); } case INT: { - return (int(*p_args[0])); + return (int64_t(*p_args[0])); } case REAL: { return real_t(*p_args[0]);