From a48e13101d794d254cf72f093b26fbc1725909e3 Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Sat, 13 Jun 2020 14:37:40 +0100 Subject: [PATCH] Ensure pair callback data is set to null when it's null. --- servers/physics_2d/broad_phase_2d_hash_grid.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/servers/physics_2d/broad_phase_2d_hash_grid.cpp b/servers/physics_2d/broad_phase_2d_hash_grid.cpp index 4c0740dc0e6..711ff9f1f78 100644 --- a/servers/physics_2d/broad_phase_2d_hash_grid.cpp +++ b/servers/physics_2d/broad_phase_2d_hash_grid.cpp @@ -83,10 +83,7 @@ void BroadPhase2DHashGrid::_check_motion(Element *p_elem) { if (pairing) { if (pair_callback) { - void *ud = pair_callback(p_elem->owner, p_elem->subindex, E->key()->owner, E->key()->subindex, pair_userdata); - if (ud) { - E->get()->ud = ud; - } + E->get()->ud = pair_callback(p_elem->owner, p_elem->subindex, E->key()->owner, E->key()->subindex, pair_userdata); } } else {