Fix empty input not used when connecting links

When dragging a link onto a node, it will always replace the first matching input type, unless you hit the (respectively small) input hit box.

This commit fixes that, honouring the intended behaviour (preferFreeSlot is true in internal calls).
This commit is contained in:
webfiltered 2024-07-21 23:55:03 +10:00
parent 95fa9545f1
commit c108421634

View File

@ -4063,7 +4063,7 @@
if (aSource[sI]=="*") aSource[sI] = 0;
if (aDest[sI]=="*") aDest[sI] = 0;
if (aSource[sI] == aDest[dI]) {
if (preferFreeSlot && aSlots[i].links && aSlots[i].links !== null) continue;
if (preferFreeSlot && (aSlots[i].links && aSlots[i].links !== null) || (aSlots[i].link && aSlots[i].link !== null)) continue;
return !returnObj ? i : aSlots[i];
}
}