Merge pull request #20992 from Chaosus/conversion_fix
Fix int(String) != int(int) conversion
This commit is contained in:
commit
240462e998
2 changed files with 2 additions and 2 deletions
|
@ -1192,7 +1192,7 @@ Variant::operator int64_t() const {
|
||||||
case BOOL: return _data._bool ? 1 : 0;
|
case BOOL: return _data._bool ? 1 : 0;
|
||||||
case INT: return _data._int;
|
case INT: return _data._int;
|
||||||
case REAL: return _data._real;
|
case REAL: return _data._real;
|
||||||
case STRING: return operator String().to_int();
|
case STRING: return operator String().to_int64();
|
||||||
default: {
|
default: {
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -1159,7 +1159,7 @@ Variant Variant::construct(const Variant::Type p_type, const Variant **p_args, i
|
||||||
return Variant(bool(*p_args[0]));
|
return Variant(bool(*p_args[0]));
|
||||||
}
|
}
|
||||||
case INT: {
|
case INT: {
|
||||||
return (int(*p_args[0]));
|
return (int64_t(*p_args[0]));
|
||||||
}
|
}
|
||||||
case REAL: {
|
case REAL: {
|
||||||
return real_t(*p_args[0]);
|
return real_t(*p_args[0]);
|
||||||
|
|
Loading…
Reference in a new issue