浏览代码

Fixed error when duplicating a scene which has connection

Fixed error when duplicating a scene which has connection
DualMatrix 7 年之前
父节点
当前提交
6afedaa498
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      scene/main/node.cpp

+ 1 - 1
scene/main/node.cpp

@@ -2192,7 +2192,7 @@ void Node::_duplicate_signals(const Node *p_original, Node *p_copy) const {
 			if (p_copy->has_node(ptarget))
 				copytarget = p_copy->get_node(ptarget);
 
-			if (copy && copytarget) {
+			if (copy && copytarget && !copy->is_connected(E->get().signal, copytarget, E->get().method)) {
 				copy->connect(E->get().signal, copytarget, E->get().method, E->get().binds, E->get().flags);
 			}
 		}