79 |
MapSearchNode NewNode; |
MapSearchNode NewNode; |
80 |
|
|
81 |
// push each possible move except allowing the search to go backwards |
// push each possible move except allowing the search to go backwards |
82 |
if( themap->IsValid(x-1, y) && (themap->GetObst(x-1, y) != 1) && !((parent_x == x-1) && (parent_y == y)) ) { |
if( themap->IsValid(x-1, y) && (themap->GetObst(x-1, y) != OBST_BLOCK) && !((parent_x == x-1) && (parent_y == y)) ) { |
83 |
NewNode = MapSearchNode( x-1, y ); |
NewNode = MapSearchNode( x-1, y ); |
84 |
astarsearch->AddSuccessor( NewNode ); |
astarsearch->AddSuccessor( NewNode ); |
85 |
} |
} |
86 |
|
|
87 |
if( themap->IsValid(x, y-1) && (themap->GetObst(x, y-1) != 1) && !((parent_x == x) && (parent_y == y-1)) ) { |
if( themap->IsValid(x, y-1) && (themap->GetObst(x, y-1) != OBST_BLOCK) && !((parent_x == x) && (parent_y == y-1)) ) { |
88 |
NewNode = MapSearchNode( x, y-1 ); |
NewNode = MapSearchNode( x, y-1 ); |
89 |
astarsearch->AddSuccessor( NewNode ); |
astarsearch->AddSuccessor( NewNode ); |
90 |
} |
} |
91 |
|
|
92 |
if( themap->IsValid(x+1, y) && (themap->GetObst(x+1, y) != 1) && !((parent_x == x+1) && (parent_y == y)) ) { |
if( themap->IsValid(x+1, y) && (themap->GetObst(x+1, y) != OBST_BLOCK) && !((parent_x == x+1) && (parent_y == y)) ) { |
93 |
NewNode = MapSearchNode( x+1, y ); |
NewNode = MapSearchNode( x+1, y ); |
94 |
astarsearch->AddSuccessor( NewNode ); |
astarsearch->AddSuccessor( NewNode ); |
95 |
} |
} |
96 |
|
|
97 |
if( themap->IsValid(x, y+1) && (themap->GetObst(x, y+1) != 1) && !((parent_x == x) && (parent_y == y+1)) ) { |
if( themap->IsValid(x, y+1) && (themap->GetObst(x, y+1) != OBST_BLOCK) && !((parent_x == x) && (parent_y == y+1)) ) { |
98 |
NewNode = MapSearchNode( x, y+1 ); |
NewNode = MapSearchNode( x, y+1 ); |
99 |
astarsearch->AddSuccessor( NewNode ); |
astarsearch->AddSuccessor( NewNode ); |
100 |
} |
} |