Skip to content

Commit add9635

Browse files
committed
Merge pull request RemoteTechnologiesGroup#322 from Peppie23/zero_cost_links
Fix for zero cost links
2 parents 775ea83 + 2bfdac5 commit add9635

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/RemoteTech/NetworkPathfinder.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ public static NetworkRoute<T> Solve<T>(T start, T goal,
4040
foreach (var link in neighborsFunction.Invoke(current.Item.Target))
4141
{
4242
double new_cost = current.Cost + costFunction.Invoke(current.Item.Target, link);
43+
44+
// Todo: Dennis: i use the fix from Taste83 #139 and i'll look closer if i'm more related to the Pathfinder
45+
if (new_cost == current.Cost)
46+
{
47+
continue;
48+
}
49+
4350
// If the item has a node, it will either be in the closedSet, or the openSet
4451
if (nodeMap.ContainsKey(link.Target))
4552
{

0 commit comments

Comments
 (0)