]> git.lizzy.rs Git - minetest.git/blobdiff - src/pathfinder.cpp
Mapgen V6: Re-enable liquid flowing
[minetest.git] / src / pathfinder.cpp
index a173e33d56fafadfec5ecb92663da3b912eddc43..d39bdab3add0a1ba243d549a2670f63c7b26033e 100644 (file)
@@ -51,9 +51,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define ERROR_TARGET     std::cout
 #else
 #define DEBUG_OUT(a)     while(0)
-#define INFO_TARGET      infostream
-#define VERBOSE_TARGET   verbosestream
-#define ERROR_TARGET     errorstream
+#define INFO_TARGET      infostream << "pathfinder: "
+#define VERBOSE_TARGET   verbosestream << "pathfinder: "
+#define ERROR_TARGET     errorstream << "pathfinder: "
 #endif
 
 /******************************************************************************/
@@ -263,13 +263,13 @@ std::vector<v3s16> pathfinder::get_Path(ServerEnvironment* env,
        path_gridnode& endpos   = getIndexElement(EndIndex);
 
        if (!startpos.valid) {
-               ERROR_TARGET << "invalid startpos" <<
+               VERBOSE_TARGET << "invalid startpos" <<
                                "Index: " << PPOS(StartIndex) <<
                                "Realpos: " << PPOS(getRealPos(StartIndex)) << std::endl;
                return retval;
        }
        if (!endpos.valid) {
-               ERROR_TARGET << "invalid stoppos" <<
+               VERBOSE_TARGET << "invalid stoppos" <<
                                "Index: " << PPOS(EndIndex) <<
                                "Realpos: " << PPOS(getRealPos(EndIndex)) << std::endl;
                return retval;
@@ -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;
                                }