diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-06-13 16:33:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-13 16:33:35 +0200 |
commit | 58034f39829b8b95a3e5d4c6e8d1ab0427371548 (patch) | |
tree | 9c5095b45431ccbf584ee44e4d139c776a694fbc /servers | |
parent | 84abf5a979648081a9076ec6b342f5f9d33093d4 (diff) | |
parent | 62142c54168c8ef86a5636edae2360518718f3b8 (diff) |
Merge pull request #39505 from madmiraal/fix-39500
Ensure pair callback data is set to null when it's null.
Diffstat (limited to 'servers')
-rw-r--r-- | servers/physics_2d/broad_phase_2d_hash_grid.cpp | 5 |
1 files changed, 1 insertions, 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 cfd02cef2c..ae549ed2e4 100644 --- a/servers/physics_2d/broad_phase_2d_hash_grid.cpp +++ b/servers/physics_2d/broad_phase_2d_hash_grid.cpp @@ -75,10 +75,7 @@ void BroadPhase2DHashGrid::_check_motion(Element *p_elem) { if (pairing != E->get()->colliding) { 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 { if (unpair_callback) { |