You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2026-01-05 19:31:35 +00:00
Fix Ref(Variant) constructor to properly check the object type
Otherwise it was saving any reference as valid, regardless of type.
This commit is contained in:
@@ -170,9 +170,9 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
Reference *r = Object::cast_to<Reference>(object);
|
||||
T *r = Object::cast_to<T>(object);
|
||||
if (r && r->reference()) {
|
||||
reference = static_cast<T *>(r);
|
||||
reference = r;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -226,9 +226,9 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
Reference *r = Object::cast_to<Reference>(object);
|
||||
T *r = Object::cast_to<T>(object);
|
||||
if (r && r->reference()) {
|
||||
reference = static_cast<T *>(r);
|
||||
reference = r;
|
||||
} else {
|
||||
reference = nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user