瀏覽代碼

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

Marcel Admiraal 5 年之前
父節點
當前提交
a48e13101d
共有 1 個文件被更改,包括 1 次插入4 次删除
  1. 1 4
      servers/physics_2d/broad_phase_2d_hash_grid.cpp

+ 1 - 4
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 {