Skip to content

Conversation

@AGulev
Copy link
Contributor

@AGulev AGulev commented Aug 11, 2025

With this fix, it will be possible to use the go.exists() function to check if a game object exists in another collection.

Fix #10795

@AGulev AGulev requested a review from britzl August 11, 2025 14:55
// Same collection - use current collection
target_instance = dmGameObject::GetInstanceFromIdentifier(dmGameObject::GetCollection(instance), target.m_Path);
}
else
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The actual fix here

if pcall(go.exists, "foo:/bar") then
assert(false, "Error expected when calling go.exists with another collection")
end
assert(not go.exists("foo:/bar"), "Expected go 'foo:/bar' (non-existent collection) to not exist")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Old test can check only negative case, I added a new one for positive case

if message_id == hash("proxy_loaded") then
if self.test_phase == "loading" then
self.test_phase = "testing"
msg.post("#target_proxy", "enable")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Setup to test all the go.exist() cases including inter-collection checking

@AGulev AGulev merged commit e43b647 into dev Aug 12, 2025
24 checks passed
@AGulev AGulev deleted the issue-10795 branch August 12, 2025 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable go.exists to query the existence of game objects across collections

3 participants