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

Allow nil indexing in world:target #131

Merged
merged 3 commits into from
Sep 23, 2024
Merged

Allow nil indexing in world:target #131

merged 3 commits into from
Sep 23, 2024

Conversation

EncodedVenom
Copy link
Collaborator

Brief Description of your Changes.

This PR allows for users to use world:target(entity, relationship, index) without specifying an index. If none is specified, this will default to 0 internally.

For example,

world:target(entity, ChildOf(parent), 0)

Can now be written like:

world:target(entity, ChildOf(parent))

Impact of your Changes

This will allow backwards compatibility with previous versions of jecs which did not have the index in world:target

Tests Performed

Added a test in the testing suite to track this change. This test passes CI.

test/tests.luau Outdated Show resolved Hide resolved
src/index.d.ts Show resolved Hide resolved
@Ukendio Ukendio merged commit 16e8055 into main Sep 23, 2024
2 checks passed
@EncodedVenom EncodedVenom deleted the nil-index-world-target branch September 23, 2024 12:31
Ukendio pushed a commit that referenced this pull request Sep 29, 2024
* Removed error about needing `index` in `world:target`

* The `index` parameter was made optional in #131

* Re-added `world.target` wrapper

* Remove world.target and world.remove wrappers

---------

Co-authored-by: EncodedVenom <32179912+EncodedVenom@users.noreply.github.com>
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