Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ArrayContains and ArrayIndex Nodes #2782

Merged
merged 1 commit into from
Feb 6, 2023

Conversation

t3du
Copy link
Contributor

@t3du t3du commented Feb 4, 2023

Both nodes returned -1 for vector items or array items (the case when the input array is an array of more than one dimension), even though those items did indeed exist in the array. That's because the indexOf function of the array class does not handle the comparison properly.

With this fix now the comparison is handled and the correct value is returned for both nodes.

@MoritzBrueckner
Copy link
Collaborator

Same as #2781 (comment), I don't think you should use string representations for comparison of values (also regarding #2783). Depending on the amount of redundant code introduced by value comparisons, Armory might profit from a method compareDynamic() or equalsDynamic() that could then be used by various nodes.

@t3du
Copy link
Contributor Author

t3du commented Feb 5, 2023

Well, in the meantime is not working at all. While the efficient code arrives, this can comply the comparison.

@luboslenco luboslenco merged commit 5a2d211 into armory3d:main Feb 6, 2023
@MoritzBrueckner MoritzBrueckner added the Release Notes: Fixes A pull request that fixes something. Used to generate release notes. label Feb 8, 2023
@t3du t3du deleted the fixArrayIndexOf branch October 6, 2023 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release Notes: Fixes A pull request that fixes something. Used to generate release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants