int ShmapIsFreeCell(int x, int y)
{
struct map_cell *cell;
- if(map && ShmapIsCellInMap(x,y)) {
+ if(map && ShmapIsCellInMap(x,y)) {
+ bool free;
cell = &(map->cells[y][x]);
- return (cell->detected_obstacle == 0) && ((cell->flags & ((MAP_FLAG_WALL&~MAP_FLAG_INVALIDATE_WALL)|MAP_FLAG_DET_OBST|MAP_FLAG_PLAN_MARGIN)) == 0);
+ free = (cell->detected_obstacle == 0) &&
+ (((cell->flags & (MAP_FLAG_WALL|MAP_FLAG_DET_OBST|MAP_FLAG_PLAN_MARGIN)) == 0) ||
+ ((cell->flags & MAP_FLAG_WALL) && (cell->flags & MAP_FLAG_INVALIDATE_WALL)));
+ return free;
}
else return -1;
}
int ShmapSetCircleFlag(double xs, double ys, double r, map_cell_flag_t set_flags, map_cell_flag_t clear_flags)
{
int i,j, i1, i2, j1, j2;
- bool valid;
// define a circumscribe square - just to shorten cyclic pass through the playground
//ShmapPoint2Cell(xs-r, ys-r, &i1, &j1, &valid);