summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-08-14 15:31:10 +0200
committerGitHub <noreply@github.com>2018-08-14 15:31:10 +0200
commit240462e99877e00c8846c4bb3e01b83ef70aac40 (patch)
tree5290f475aabe75afc0e3bf6d7cb170fa63b73dbb
parent6f025dc4d374e159d4d23ad52511e543ef38d112 (diff)
parent3b10bd1fa2b365d5c346894f7f1b406ee2e30e5d (diff)
Merge pull request #20992 from Chaosus/conversion_fix
Fix int(String) != int(int) conversion
-rw-r--r--core/variant.cpp2
-rw-r--r--core/variant_call.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/core/variant.cpp b/core/variant.cpp
index e4be5520bc..9fa51ec7c9 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 19308ff683..b312316f9a 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]);