diff --git a/pcbnew/router/pns_item.cpp b/pcbnew/router/pns_item.cpp index 9a52ab0551..de494fa34a 100644 --- a/pcbnew/router/pns_item.cpp +++ b/pcbnew/router/pns_item.cpp @@ -36,7 +36,7 @@ bool ITEM::collideSimple( const ITEM* aOther, int aClearance, bool aNeedMTV, VEC const SHAPE* shapeB = aOther->Shape(); // same nets? no collision! - if( aDifferentNetsOnly && m_net == aOther->m_net && m_net >= 0 && aOther->m_net >= 0 ) + if( aDifferentNetsOnly && m_net == aOther->m_net && m_net > 0 && aOther->m_net > 0 ) return false; // check if we are not on completely different layers first diff --git a/pcbnew/router/pns_tool_base.cpp b/pcbnew/router/pns_tool_base.cpp index 8567f6ca24..154b6bee6e 100644 --- a/pcbnew/router/pns_tool_base.cpp +++ b/pcbnew/router/pns_tool_base.cpp @@ -315,7 +315,7 @@ void TOOL_BASE::updateEndItem( const TOOL_EVENT& aEvent ) VECTOR2I mousePos = controls()->GetMousePosition(); if( m_router->Settings().Mode() != RM_MarkObstacles && - ( m_router->GetCurrentNets().empty() || m_router->GetCurrentNets().front() < 0 ) ) + ( m_router->GetCurrentNets().empty() || m_router->GetCurrentNets().front() <= 0 ) ) { m_endSnapPoint = snapToItem( snapEnabled, nullptr, mousePos ); controls()->ForceCursorPosition( true, m_endSnapPoint ); diff --git a/pcbnew/router/pns_topology.cpp b/pcbnew/router/pns_topology.cpp index c54d48c153..619f952dc2 100644 --- a/pcbnew/router/pns_topology.cpp +++ b/pcbnew/router/pns_topology.cpp @@ -116,10 +116,12 @@ bool TOPOLOGY::LeadingRatLine( const LINE* aTrack, SHAPE_LINE_CHAIN& aRatLine ) } else { - int anchor; - TOPOLOGY topo( tmpNode.get() ); - ITEM* it = topo.NearestUnconnectedItem( jt, &anchor ); + int anchor = 0; + ITEM* it = nullptr; + + if( jt->Net() > 0 ) + it = topo.NearestUnconnectedItem( jt, &anchor ); if( !it ) return false; diff --git a/pcbnew/router/router_tool.cpp b/pcbnew/router/router_tool.cpp index f8693e06cb..f29bdbe4b5 100644 --- a/pcbnew/router/router_tool.cpp +++ b/pcbnew/router/router_tool.cpp @@ -927,7 +927,7 @@ bool ROUTER_TOOL::prepareInteractive() editFrame->SetActiveLayer( ToLAYER_ID( routingLayer ) ); - if( m_startItem && m_startItem->Net() >= 0 ) + if( m_startItem && m_startItem->Net() > 0 ) highlightNet( true, m_startItem->Net() ); controls()->ForceCursorPosition( false );