Fix inadvertent logic bug in SearchClusters

The safety changes in 3d526edc introduced a subtle
bug where aExcludeZones was not actually excluding
zones anymore because its behavior depended on the
item visited flag being set to true by a previous
call to the function.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20090


(cherry picked from commit 51f56ab31c)

Co-authored-by: Jon Evans <jon@craftyjon.com>
This commit is contained in:
Jon Evans
2025-03-01 15:39:57 +00:00
parent d08cb55d94
commit 9055821db6
@@ -416,6 +416,9 @@ CN_CONNECTIVITY_ALGO::SearchClusters( CLUSTER_SEARCH_MODE aMode, const std::vect
if( withinAnyNet && n->Net() != root->Net() )
continue;
if( aExcludeZones && n->Parent()->Type() == PCB_ZONE_T )
continue;
if( !visited.contains( n ) && n->Valid() )
{
visited.insert( n );