Skip to content

Commit ea5d572

Browse files
committed
Hide command-station routes rooted at filtered-out vessels
The multi-path overlay drew every tree edge in the command-station forest, so a vessel hidden by the map view filter still showed its green route back to control. Seed the on-path set by walking the predecessor forest from each visible vessel instead, so a route is drawn only when a visible vessel sits at its far end.
1 parent 8562f2b commit ea5d572

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

src/RemoteTech/Network/LineMeshJob.cs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,19 @@ public void Execute()
7474
for (int cur = p.targetNode; cur >= 0; cur = parent[cur])
7575
onPath.Set(cur, true);
7676
}
77+
// A route back to the command station is only worth drawing if a visible
78+
// vessel actually sits at its far end; a path rooted at a filtered-out
79+
// vessel stays hidden even though its edges still exist in the forest.
80+
if (p.showMultiPath != 0)
81+
{
82+
for (int i = 0; i < p.nodeCount; i++)
83+
{
84+
if (nodes[i].kind != NodeKind.Vessel || (nodes[i].flags & NodeFlags.Visible) == 0)
85+
continue;
86+
for (int cur = i; cur >= 0; cur = parent[cur])
87+
onPath.Set(cur, true);
88+
}
89+
}
7790

7891
outEdges.Capacity = math.max(p.nodeCount, 16);
7992
outEdges.Clear();
@@ -84,8 +97,7 @@ public void Execute()
8497
continue;
8598

8699
bool tree = parent[r.aIdx] == r.bIdx || parent[r.bIdx] == r.aIdx;
87-
bool onP = (p.showPath != 0 && tree && onPath.IsSet(r.aIdx) && onPath.IsSet(r.bIdx))
88-
|| (p.showMultiPath != 0 && tree);
100+
bool onP = tree && onPath.IsSet(r.aIdx) && onPath.IsSet(r.bIdx);
89101

90102
bool visA = (nodes[r.aIdx].flags & NodeFlags.Visible) != 0;
91103
bool visB = (nodes[r.bIdx].flags & NodeFlags.Visible) != 0;

0 commit comments

Comments
 (0)