Commit f63e2b6e authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

simplify code and guarantee that "mode" is initialized

parent ae0979e1
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -641,18 +641,15 @@ int FixWallBodyPolygon::compute_distance_to_wall(double* x0, double rradi,
    mode = VERTEX;
    contact = 1;
  } else {
    mode = NONE;
    if (side == XLO) {
      if (x0[0] < wall_pos) mode = VERTEX;
      else mode = NONE;
    } else if (side == XHI) {
      if (x0[0] > wall_pos) mode = VERTEX;
      else mode = NONE;
    } else if (side == YLO) {
      if (x0[1] < wall_pos) mode = VERTEX;
      else mode = NONE;
    } else if (side == YHI) {
      if (x0[1] > wall_pos) mode = VERTEX;
      else mode = NONE;
    }
  }