Skip to content

Commit

Permalink
Merge pull request #39505 from madmiraal/fix-39500
Browse files Browse the repository at this point in the history
Ensure pair callback data is set to null when it's null.
  • Loading branch information
akien-mga authored Jun 13, 2020
2 parents 84abf5a + 62142c5 commit 58034f3
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions servers/physics_2d/broad_phase_2d_hash_grid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 58034f3

Please sign in to comment.