diff --git a/src/js/game/hud/parts/wires_overlay.js b/src/js/game/hud/parts/wires_overlay.js index f493826f..256abf19 100644 --- a/src/js/game/hud/parts/wires_overlay.js +++ b/src/js/game/hud/parts/wires_overlay.js @@ -108,6 +108,7 @@ export class HUDWiresOverlay extends BaseHUDPart { // Go over all slots and see if they are close to mouse or not const pinSlots = pinComp.slots; + let minLength = Infinity; for (let i = 0; i < pinSlots.length; ++i) { const slot = pinSlots[i]; @@ -127,7 +128,8 @@ export class HUDWiresOverlay extends BaseHUDPart { const length = mouseTilePos.sub(valueSpritePos).length(); // If it is closer than 8 we can copy that value - if (length <= 8) { + if (length < minLength) { + minLength = length; value = slot.value; } }