summaryrefslogtreecommitdiff
path: root/servers/physics_2d/broad_phase_2d_basic.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'servers/physics_2d/broad_phase_2d_basic.cpp')
-rw-r--r--servers/physics_2d/broad_phase_2d_basic.cpp4
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);
}
}
}