diff options
| author | Juan Linietsky <juan@godotengine.org> | 2020-02-12 14:24:06 -0300 |
|---|---|---|
| committer | Juan Linietsky <juan@godotengine.org> | 2020-02-12 14:24:54 -0300 |
| commit | cf8c679a23b21d6c6f29cba6a54eaa2eed88bf92 (patch) | |
| tree | 52aca947b395362b2addec4843915b15947c32ca /core/variant.cpp | |
| parent | 4aa31a2851e3dd5b67193194f899850239b2669d (diff) | |
| download | redot-engine-cf8c679a23b21d6c6f29cba6a54eaa2eed88bf92.tar.gz | |
ObjectID converted to a structure, fixes many bugs where used incorrectly as 32 bits.
Diffstat (limited to 'core/variant.cpp')
| -rw-r--r-- | core/variant.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/core/variant.cpp b/core/variant.cpp index f4e4cd5341..0f04710d13 100644 --- a/core/variant.cpp +++ b/core/variant.cpp @@ -1248,6 +1248,14 @@ Variant::operator uint64_t() const { } } +Variant::operator ObjectID() const { + if (type == INT) { + return ObjectID(_data._int); + } else { + return ObjectID(); + } +} + #ifdef NEED_LONG_INT Variant::operator signed long() const { @@ -2193,6 +2201,11 @@ Variant::Variant(double p_double) { _data._real = p_double; } +Variant::Variant(const ObjectID &p_id) { + type = INT; + _data._int = p_id; +} + Variant::Variant(const StringName &p_string) { type = STRING; |
