48 |
|
|
49 |
if( themap->IsValid(checker.x, checker.y) == 1 ) { // is valid |
if( themap->IsValid(checker.x, checker.y) == 1 ) { // is valid |
50 |
temp = themap->GetOccu(checker.x, checker.y); // get occupant if any |
temp = themap->GetOccu(checker.x, checker.y); // get occupant if any |
51 |
if ( (themap->GetObst(checker.x, checker.y) != 1) && // is not a blocked tile |
if ( (themap->GetObst(checker.x, checker.y) != OBST_BLOCK) && // is not a blocked tile |
52 |
!((parent_x == checker.x) && (parent_y == checker.y) ) // isn't where we just came from |
!((parent_x == checker.x) && (parent_y == checker.y) ) // isn't where we just came from |
53 |
) { |
) { |
54 |
if (temp == NULL || checker.IsGoal( *(astarsearch->GetSolutionEnd()) ) == 1) { // if not already occupied -OR- it's the goal state. |
if (temp == NULL || checker.IsGoal( *(astarsearch->GetSolutionEnd()) ) == 1) { // if not already occupied -OR- it's the goal state. |