Ensure pair callback data is set to null when it's null.

This commit is contained in:
Marcel Admiraal 2020-06-13 14:43:25 +01:00
parent 84abf5a979
commit 62142c5416
1 changed files with 1 additions and 4 deletions

View File

@ -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) {