Fix nested if in collision-detection

This commit is contained in:
Sage Vaillancourt 2025-03-21 12:17:39 -04:00
parent 64a9dbc148
commit a058d7f9b1
1 changed files with 2 additions and 7 deletions

View File

@ -32,15 +32,10 @@ world:filteredSystem(
and collider.canCollideWith and collider.canCollideWith
and e.canBeCollidedBy and e.canBeCollidedBy
and bit.band(collider.canCollideWith, e.canBeCollidedBy) ~= 0 and bit.band(collider.canCollideWith, e.canBeCollidedBy) ~= 0
then and intersects(e, collider) then
if intersects(e, collider) then
system.world:addEntity({ system.world:addEntity({
collisionBetween = { collisionBetween = { collider = collider, collidedInto = e },
collider = collider,
collidedInto = e,
},
}) })
end
end end
end end
end end