1
Fork 0
mirror of https://github.com/Steffo99/swear-jar.git synced 2024-11-21 23:34:18 +00:00

Use bitwise and for spawner overlap collision mask

This commit is contained in:
Steffo 2023-10-01 02:47:54 +02:00
parent 5f3e361a9d
commit 227487f58c
Signed by: steffo
GPG key ID: 2A24051445686895

View file

@ -28,7 +28,7 @@ func _count_overlapping_bodies() -> int:
var overlapping_bodies = area.get_overlapping_bodies()
var overlapping_body_count = 0
for overlapping_body in overlapping_bodies:
if overlapping_body.collision_layer && overlapping_bodies_collision_mask:
if overlapping_body.collision_layer & overlapping_bodies_collision_mask:
overlapping_body_count += 1
return overlapping_body_count