Skip to content
Snippets Groups Projects
Commit f63e2b6e authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

simplify code and guarantee that "mode" is initialized

parent ae0979e1
No related branches found
No related tags found
No related merge requests found
...@@ -641,18 +641,15 @@ int FixWallBodyPolygon::compute_distance_to_wall(double* x0, double rradi, ...@@ -641,18 +641,15 @@ int FixWallBodyPolygon::compute_distance_to_wall(double* x0, double rradi,
mode = VERTEX; mode = VERTEX;
contact = 1; contact = 1;
} else { } else {
mode = NONE;
if (side == XLO) { if (side == XLO) {
if (x0[0] < wall_pos) mode = VERTEX; if (x0[0] < wall_pos) mode = VERTEX;
else mode = NONE;
} else if (side == XHI) { } else if (side == XHI) {
if (x0[0] > wall_pos) mode = VERTEX; if (x0[0] > wall_pos) mode = VERTEX;
else mode = NONE;
} else if (side == YLO) { } else if (side == YLO) {
if (x0[1] < wall_pos) mode = VERTEX; if (x0[1] < wall_pos) mode = VERTEX;
else mode = NONE;
} else if (side == YHI) { } else if (side == YHI) {
if (x0[1] > wall_pos) mode = VERTEX; if (x0[1] > wall_pos) mode = VERTEX;
else mode = NONE;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment