summaryrefslogtreecommitdiff
path: root/servers
diff options
context:
space:
mode:
authorPedro J. Estébanez <pedrojrulez@gmail.com>2017-07-25 04:06:37 +0200
committerPedro J. Estébanez <pedrojrulez@gmail.com>2017-07-25 04:45:01 +0200
commitfa1049b46bd1d8b9c6b75b815fa503ecc2811bf0 (patch)
treee172ea038dc683ad0fe1211e048850f27e834132 /servers
parent91bb4952e4f01d8a8fa729c2db2fb6beb5bce0ec (diff)
Fix early-accepting area-area match when masks don't match
Diffstat (limited to 'servers')
-rw-r--r--servers/physics/space_sw.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/servers/physics/space_sw.cpp b/servers/physics/space_sw.cpp
index 5679fc8f60..094cfa4656 100644
--- a/servers/physics/space_sw.cpp
+++ b/servers/physics/space_sw.cpp
@@ -34,12 +34,12 @@
_FORCE_INLINE_ static bool _match_object_type_query(CollisionObjectSW *p_object, uint32_t p_collision_layer, uint32_t p_type_mask) {
- if (p_object->get_type() == CollisionObjectSW::TYPE_AREA)
- return p_type_mask & PhysicsDirectSpaceState::TYPE_MASK_AREA;
-
if ((p_object->get_collision_layer() & p_collision_layer) == 0)
return false;
+ if (p_object->get_type() == CollisionObjectSW::TYPE_AREA)
+ return p_type_mask & PhysicsDirectSpaceState::TYPE_MASK_AREA;
+
BodySW *body = static_cast<BodySW *>(p_object);
return (1 << body->get_mode()) & p_type_mask;