Ticket #1756: FixGoalDetection.patch
File FixGoalDetection.patch, 1.6 KB (added by , 10 years ago) |
---|
-
source/simulation2/components/CCmpPathfinder_JPS.cpp
27 27 28 28 #define PATHFIND_STATS 0 29 29 30 #define USE_JUMPPOINT_CACHE 130 #define USE_JUMPPOINT_CACHE 0 31 31 32 32 #define ACCEPT_DIAGONAL_GAPS 0 33 33 … … (this hunk was shorter than expected) 645 645 if (!PASSABLE(ni, j)) 646 646 break; 647 647 648 if ( (ni == state.iGoal && j == state.jGoal) || // XXX648 if (state.goal.NavcellContainsGoal(ni, j) || 649 649 #if ACCEPT_DIAGONAL_GAPS 650 650 (!PASSABLE(ni, j-1) && PASSABLE(ni+di, j-1)) || 651 651 (!PASSABLE(ni, j+1) && PASSABLE(ni+di, j+1))) … … (this hunk was shorter than expected) 671 672 if (!PASSABLE(ni, j)) 672 673 return false; 673 674 674 if ( (ni == state.iGoal && j == state.jGoal) || // XXX675 if (state.goal.NavcellContainsGoal(ni, j) || 675 676 #if ACCEPT_DIAGONAL_GAPS 676 677 (!PASSABLE(ni, j-1) && PASSABLE(ni+di, j-1)) || 677 678 (!PASSABLE(ni, j+1) && PASSABLE(ni+di, j+1))) … … (this hunk was shorter than expected) 696 698 if (!PASSABLE(i, nj)) 697 699 break; 698 700 699 if ( (i == state.iGoal && nj == state.jGoal) ||701 if (state.goal.NavcellContainsGoal(i, nj) || 700 702 #if ACCEPT_DIAGONAL_GAPS 701 703 (!PASSABLE(i-1, nj) && PASSABLE(i-1, nj+dj)) || 702 704 (!PASSABLE(i+1, nj) && PASSABLE(i+1, nj+dj))) … … 722 725 if (!PASSABLE(i, nj)) 723 726 return false; 724 727 725 if ( (i == state.iGoal && nj == state.jGoal) ||728 if (state.goal.NavcellContainsGoal(i, nj) || 726 729 #if ACCEPT_DIAGONAL_GAPS 727 730 (!PASSABLE(i-1, nj) && PASSABLE(i-1, nj+dj)) || 728 731 (!PASSABLE(i+1, nj) && PASSABLE(i+1, nj+dj)))