]> git.lizzy.rs Git - minetest.git/commitdiff
Fix bug in pathfinder causing endless loop in some situations
authorsapier <Sapier at GMX dot net>
Sat, 24 Aug 2013 21:42:02 +0000 (23:42 +0200)
committerproller <proller@github.com>
Sat, 31 Aug 2013 17:26:51 +0000 (21:26 +0400)
src/pathfinder.cpp

index a173e33d56fafadfec5ecb92663da3b912eddc43..3e8a73ac25683341914d881d4a4e4c7b51bf2b96 100644 (file)
@@ -823,6 +823,7 @@ bool pathfinder::update_cost_heuristic(     v3s16 ipos,
                                                        " out of range (" << m_limits.X.max << "," <<
                                                        m_limits.Y.max << "," << m_limits.Z.max
                                                        <<")" << std::endl);
+                                       direction = get_dir_heuristic(directions,g_pos);
                                        continue;
                                }
 
@@ -831,6 +832,7 @@ bool pathfinder::update_cost_heuristic(     v3s16 ipos,
                                if (!g_pos2.valid) {
                                        VERBOSE_TARGET << LVL "Pathfinder: no data for new position: "
                                                                                                << PPOS(ipos2) << std::endl;
+                                       direction = get_dir_heuristic(directions,g_pos);
                                        continue;
                                }