Ukendio / jecs

A fast, portable Entity Component System for Luau
https://ukendio.github.io/jecs/
MIT License
146 stars 26 forks source link

Allow nil indexing in world:target #131

Closed EncodedVenom closed 1 month ago

EncodedVenom commented 1 month ago

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.