Did a full code review to identify things to fix and either fixed them or noted BUG where I should come back.
This commit is contained in:
parent
ae43dad499
commit
9abb39a3bf
14 changed files with 72 additions and 35 deletions
|
@ -16,6 +16,7 @@ inline void add_neighbors(PointList &neighbors, Matrix &closed, size_t y, size_t
|
|||
(0 <= col && col < w) &&
|
||||
closed[row][col] == 0)
|
||||
{
|
||||
// BUG: maybe value here?
|
||||
closed[row][col] = 1;
|
||||
neighbors.push_back({.x=col, .y=row});
|
||||
}
|
||||
|
@ -43,8 +44,8 @@ void Pathing::compute_paths(Matrix &walls) {
|
|||
size_t y = counter / $width;
|
||||
if($input[y][x] == 0) {
|
||||
$paths[y][x] = 0;
|
||||
closed[y][x] = 1;
|
||||
starting_pixels.push_back({.x=x,.y=y});
|
||||
closed[y][x] = 1; // BUG: value here?
|
||||
starting_pixels.push_back({x,y});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -71,6 +72,7 @@ void Pathing::compute_paths(Matrix &walls) {
|
|||
}
|
||||
|
||||
void Pathing::set_target(const Point &at, int value) {
|
||||
// BUG: not using value here but it can be < 0 for deeper slopes
|
||||
$input[at.y][at.x] = 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue