Fix: Duplicate link search entries for attribute statistic node

Using the output declarations is incorrect because there is a
declaration for each type. Instead loop over the names directly,
since it will make it easier to add an integer mode that only
supports some of the outputs.
This commit is contained in:
Hans Goudey 2021-12-28 12:44:36 -06:00
parent 4cbcfd22f5
commit 955748ab1e
1 changed files with 2 additions and 2 deletions

View File

@ -148,8 +148,8 @@ static void node_gather_link_searches(GatherLinkSearchOpParams &params)
});
}
else {
for (const SocketDeclarationPtr &socket_decl : declaration.outputs()) {
StringRefNull name = socket_decl->name();
for (const StringRefNull name :
{"Mean", "Median", "Sum", "Min", "Max", "Range", "Standard Deviation", "Variance"}) {
params.add_item(IFACE_(name.c_str()), [node_type, name, type](LinkSearchOpParams &params) {
bNode &node = params.add_node(node_type);
node.custom1 = *type;