Don't return too many paths.

This commit is contained in:
JoelKatz
2013-11-08 11:05:05 -08:00
parent f04b9131cc
commit cf71680aee

View File

@@ -355,7 +355,7 @@ STPathSet Pathfinder::filterPaths(int iMaxPaths, STPath& extraPath)
{
path_LQ_t& lqt = vMap[i];
if ((iPathsLeft > 1) || (lqt.get<2> () >= remaining))
if ((iPathsLeft > 1) || ((iPathsLeft > 0) && (lqt.get<2> () >= remaining)))
{
// last path must fill
--iPathsLeft;