summaryrefslogtreecommitdiff
path: root/core/variant/variant_internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/variant/variant_internal.h')
-rw-r--r--core/variant/variant_internal.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/core/variant/variant_internal.h b/core/variant/variant_internal.h
index 40c8a1bfde..ad095c27e7 100644
--- a/core/variant/variant_internal.h
+++ b/core/variant/variant_internal.h
@@ -300,6 +300,13 @@ public:
v->_get_obj().id = ObjectID();
}
+ static void update_object_id(Variant *v) {
+ const Object *o = v->_get_obj().obj;
+ if (o) {
+ v->_get_obj().id = o->get_instance_id();
+ }
+ }
+
_FORCE_INLINE_ static void *get_opaque_pointer(Variant *v) {
switch (v->type) {
case Variant::NIL: