Both pads must have nets to be shorting.

Fixes https://gitlab.com/kicad/code/kicad/issues/5047
This commit is contained in:
Jeff Young 2020-08-02 13:35:25 +01:00
parent ef2388b5bb
commit 6d319e5bf7
1 changed files with 5 additions and 4 deletions

View File

@ -1188,11 +1188,12 @@ bool DRC::doPadToPadsDrc( BOARD_COMMIT& aCommit, D_PAD* aRefPad, D_PAD** aStart,
if( pad->GetNetCode() && ( aRefPad->GetNetCode() == pad->GetNetCode() ) ) if( pad->GetNetCode() && ( aRefPad->GetNetCode() == pad->GetNetCode() ) )
continue; continue;
// if pads are from the same footprint // If pads are equivalent (ie: from the same footprint with the same pad number)...
if( pad->GetParent() == aRefPad->GetParent() ) if( pad->GetParent() == aRefPad->GetParent() && pad->PadNameEqual( aRefPad ) )
{ {
// and have the same pad number ( equivalent pads ) // ...and have nets, then they must be the same net
if( pad->PadNameEqual( aRefPad ) ) if( pad->GetNetCode() && aRefPad->GetNetCode()
&& pad->GetNetCode() != aRefPad->GetNetCode() )
{ {
DRC_ITEM* drcItem = DRC_ITEM::Create( DRCE_SHORTING_ITEMS ); DRC_ITEM* drcItem = DRC_ITEM::Create( DRCE_SHORTING_ITEMS );