We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
local ent1 = { foo = true } local ent2 = { bar = 1 } local tiny = require("tiny") local world = tiny.world() tiny.addEntity(world, ent1) tiny.addEntity(world, ent2) tiny.refresh(world) local sys = tiny.processingSystem({ isSystem = true }) sys.filter = tiny.requireAny("foo", "bar") function sys:process(e) print("foo is: " .. tostring(e.foo)) print("bar is: " .. tostring(e.bar) .. "\n") end tiny.addSystem(world, sys) local filter = tiny.requireAll("isSystem") tiny.update(world, 1, filter)
Results in:
foo is: true bar is: nil foo is: nil bar is: 1
Instead of the expected:
foo is: true bar is: 1
The issue also occurs when processing 2 entities after selecting them with:
tiny.setSystemIndex(world, system)
or:
tiny.requireAll (...)
Is there a "tiny-ecs way" to get the expected behavior ?
Or do I have to add checks for nill values like:
local ent1 = { foo = true } local ent2 = { bar = 1 } local tiny = require("tiny") local world = tiny.world() tiny.addEntity(world, ent1) tiny.addEntity(world, ent2) tiny.refresh(world) local sys = tiny.processingSystem({ isSystem = true }) sys.filter = tiny.requireAny("foo", "bar") function sys:process(e) if e.foo ~= nill then print("foo is: " .. tostring(e.foo)) end if e.bar ~= nil then print("bar is: " .. tostring(e.bar) .. "\n") end end tiny.addSystem(world, sys) local filter = tiny.requireAll("isSystem") tiny.update(world, 1, filter)
To get the values of components "foo" and "bar" as:
I encountered the issue in both the latest git and the 1.3-3 release.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Results in:
Instead of the expected:
The issue also occurs when processing 2 entities after selecting them with:
or:
Is there a "tiny-ecs way" to get the expected behavior ?
Or do I have to add checks for nill values like:
To get the values of components "foo" and "bar" as:
I encountered the issue in both the latest git and the 1.3-3 release.
The text was updated successfully, but these errors were encountered: