Skip to content

Support default values when using new property options API#264

Merged
Jhonnyg merged 1 commit intomainfrom
property-options-fix
Feb 16, 2026
Merged

Support default values when using new property options API#264
Jhonnyg merged 1 commit intomainfrom
property-options-fix

Conversation

@Jhonnyg
Copy link
Contributor

@Jhonnyg Jhonnyg commented Feb 16, 2026

No description provided.

Comment on lines -1241 to +1245
dmhash_t value = 0;
int32_t value_index = 0;

if (dmGameObject::GetPropertyOptionsIndex(params.m_Options, 0, &value_index) != dmGameObject::PROPERTY_RESULT_OK)
dmhash_t tmp;
if (dmGameObject::GetPropertyOptionsKey(params.m_Options, 0, &tmp) == dmGameObject::PROPERTY_RESULT_OK)
{
return dmGameObject::PROPERTY_RESULT_INVALID_KEY;
}
Copy link
Contributor Author

@Jhonnyg Jhonnyg Feb 16, 2026

Choose a reason for hiding this comment

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

The issue with the old code was that if options table had no entries at all, we would return invalid key. Instead now we use default value.

@Jhonnyg Jhonnyg merged commit 5ae0eeb into main Feb 16, 2026
27 checks passed
@Jhonnyg Jhonnyg deleted the property-options-fix branch February 16, 2026 20:18
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.

2 participants