bit.band local in coll. detection

This commit is contained in:
Sage Vaillancourt 2025-03-21 12:18:33 -04:00
parent a058d7f9b1
commit 3af687b28d
1 changed files with 2 additions and 1 deletions

View File

@ -1,4 +1,5 @@
local world = require("world")
local band = bit.band
local collidingEntities = world:filteredSystem("collidingEntitites", {
position = T.XyPair,
@ -31,7 +32,7 @@ world:filteredSystem(
(e ~= collider)
and collider.canCollideWith
and e.canBeCollidedBy
and bit.band(collider.canCollideWith, e.canBeCollidedBy) ~= 0
and band(collider.canCollideWith, e.canBeCollidedBy) ~= 0
and intersects(e, collider) then
system.world:addEntity({
collisionBetween = { collider = collider, collidedInto = e },