Skip to content

Directly get object instance ID from Variant and implement Variant::get_validated_object()#1591

Merged
dsnopek merged 1 commit into
godotengine:masterfrom
dsnopek:variant-object-instance-id
Oct 29, 2024
Merged

Directly get object instance ID from Variant and implement Variant::get_validated_object()#1591
dsnopek merged 1 commit into
godotengine:masterfrom
dsnopek:variant-object-instance-id

Conversation

@dsnopek

@dsnopek dsnopek commented Sep 17, 2024

Copy link
Copy Markdown
Collaborator

This will fix issue #1587 after Godot PR godotengine/godot#97119 is merged (which probably means Godot 4.4+)

It allows us to safely call Variant::operator ObjectID() even on objects that have been freed, and implements Variant::get_validated_object() which exists in Godot itself, and is a very convenient way to check if an object is valid.

Marking as a draft until PR godotengine/godot#97119 is merged

@dsnopek dsnopek added enhancement This is an enhancement on the current functionality waiting for Godot PRs that can't be merged until an engine PR is merged first labels Sep 17, 2024
@dsnopek dsnopek added this to the 4.x milestone Sep 17, 2024
@dsnopek
dsnopek requested a review from a team as a code owner September 17, 2024 15:02
@dsnopek
dsnopek marked this pull request as draft September 17, 2024 15:02
@dsnopek dsnopek removed the waiting for Godot PRs that can't be merged until an engine PR is merged first label Oct 4, 2024
@dsnopek
dsnopek marked this pull request as ready for review October 16, 2024 14:14
Comment thread test/src/example.cpp Outdated
@dsnopek
dsnopek force-pushed the variant-object-instance-id branch from 8879c22 to 0602c32 Compare October 17, 2024 14:59

@paddy-exe paddy-exe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed at the GDExtension meeting. Changes look good.

@dsnopek
dsnopek merged commit fa3dfa0 into godotengine:master Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement This is an enhancement on the current functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants