浏览代码

Object: get_signal_connection_list fixed

now returns only the connections for the signal argument, as specified
fixes #5329
J08nY 9 年之前
父节点
当前提交
621b8d1324
共有 1 个文件被更改,包括 10 次插入8 次删除
  1. 10 8
      core/object.cpp

+ 10 - 8
core/object.cpp

@@ -1320,14 +1320,16 @@ Array Object::_get_signal_connection_list(const String& p_signal) const{
 	for (List<Connection>::Element *E=conns.front();E;E=E->next()) {
 	for (List<Connection>::Element *E=conns.front();E;E=E->next()) {
 
 
 		Connection &c=E->get();
 		Connection &c=E->get();
-		Dictionary rc;
-		rc["signal"]=c.signal;
-		rc["method"]=c.method;
-		rc["source"]=c.source;
-		rc["target"]=c.target;
-		rc["binds"]=c.binds;
-		rc["flags"]=c.flags;
-		ret.push_back(rc);
+		if (c.signal == p_signal){
+			Dictionary rc;
+			rc["signal"]=c.signal;
+			rc["method"]=c.method;
+			rc["source"]=c.source;
+			rc["target"]=c.target;
+			rc["binds"]=c.binds;
+			rc["flags"]=c.flags;
+			ret.push_back(rc);
+		}
 	}
 	}
 
 
 	return ret;
 	return ret;