Skip to content

Commit

Permalink
fix: 🐛 Fix bug with downloadMap that made it mark earlier traversals …
Browse files Browse the repository at this point in the history
…as obstacles when downloading saame map.

#137
  • Loading branch information
jmnorheim committed Dec 6, 2024
1 parent 92d5633 commit cf6ad44
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions frontend/src/services/mapHandling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,10 @@ function parseNodes(map: Node[]): string {
let csvText = "";
for (const node of map) {
// Exclude nodes with isPath = true
if (!node.isPath) {
csvText += `${node.x},${node.y},${node.weight},${node.isPath}\n`;
if (node.isPath || node.isExplored) {
node.weight = 0;
}
csvText += `${node.x},${node.y},${node.weight}\n`;
}
return csvText;
}

0 comments on commit cf6ad44

Please sign in to comment.