We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c15d18d commit 0d4f28cCopy full SHA for 0d4f28c
1 file changed
A_Star_Search/Lua/Yonaba/point_graph_handler.lua
@@ -56,7 +56,7 @@ function handler.addNode(name) graph.nodes[name] = Node(name) end
56
-- Adds a new edge between nodes labelled from and to
57
function handler.addEdge(from, to, weight)
58
table.insert(graph.edges,
59
- {from = graph.nodes[from], to = graph.nodes[to], weight = weight})
+ {from = graph.nodes[from], to = graph.nodes[to], weight = weight or 0})
60
end
61
62
-- Sets the weight of edge from -> to
0 commit comments