diff options
author | Marcel Admiraal <madmiraal@users.noreply.github.com> | 2020-06-08 17:46:21 +0100 |
---|---|---|
committer | Marcel Admiraal <madmiraal@users.noreply.github.com> | 2020-06-08 17:46:21 +0100 |
commit | a44252674472787a15ac3e1b458eb7e6f91afa3c (patch) | |
tree | 0977a19d038202779313f7a6ef75e8a0859ffae9 /servers/physics_2d/broad_phase_2d_basic.cpp | |
parent | 87b2d3f9cf2dee1f885eaba9d17215ecbcacf391 (diff) |
Test collision mask before creating constraint pair in Godot physics broadphase 2D and 3D.
Diffstat (limited to 'servers/physics_2d/broad_phase_2d_basic.cpp')
-rw-r--r-- | servers/physics_2d/broad_phase_2d_basic.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/servers/physics_2d/broad_phase_2d_basic.cpp b/servers/physics_2d/broad_phase_2d_basic.cpp index 8c7e715a09..3bdfc1a973 100644 --- a/servers/physics_2d/broad_phase_2d_basic.cpp +++ b/servers/physics_2d/broad_phase_2d_basic.cpp @@ -152,8 +152,10 @@ void BroadPhase2DBasic::update() { void *data = nullptr; if (pair_callback) { data = pair_callback(elem_A->owner, elem_A->subindex, elem_B->owner, elem_B->subindex, unpair_userdata); + if (data) { + pair_map.insert(key, data); + } } - pair_map.insert(key, data); } } } |