Fix pathfinding in case start = end
This commit is contained in:
parent
9f0c5a78c3
commit
8a7e95a6d1
1 changed files with 2 additions and 2 deletions
|
|
@ -101,10 +101,10 @@ namespace psemek::util
|
||||||
Node node = end;
|
Node node = end;
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
*it++ = node;
|
|
||||||
node = previous.at(node);
|
|
||||||
if (node == start)
|
if (node == start)
|
||||||
break;
|
break;
|
||||||
|
*it++ = node;
|
||||||
|
node = previous.at(node);
|
||||||
}
|
}
|
||||||
return it;
|
return it;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue