1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Merge pull request #107868 from lawnjelly/quick_ancestry4

Provide quick access to `Object` ancestry
This commit is contained in:
Thaddeus Crews
2025-09-20 13:41:39 -05:00
18 changed files with 86 additions and 9 deletions

View File

@@ -2228,9 +2228,20 @@ void Object::reset_internal_extension(ObjectGDExtension *p_extension) {
#endif
void Object::_construct_object(bool p_reference) {
type_is_reference = p_reference;
_block_signals = false;
_can_translate = true;
_emitting = false;
// ObjectDB::add_instance relies on AncestralClass::REF_COUNTED
// being already set in the case of references.
_ancestry = p_reference ? (uint32_t)AncestralClass::REF_COUNTED : 0;
_instance_id = ObjectDB::add_instance(this);
#ifdef TOOLS_ENABLED
_edited = false;
#endif
#ifdef DEBUG_ENABLED
_lock_index.init(1);
#endif