Doors are placed and you can walk through them, also fixed the way the jankifier renders so that it uses a consistent bit depth for all the textures.
This commit is contained in:
parent
0add3b29ae
commit
4c11829580
30 changed files with 16 additions and 3 deletions
|
|
@ -77,12 +77,17 @@ PathingResult Pathing::find_path(Point &out, int direction, bool diag)
|
|||
// get the current dijkstra number
|
||||
int cur = $paths[out.y][out.x];
|
||||
int target = cur;
|
||||
// BUG: can I shortcut if target == 0 now?
|
||||
|
||||
bool found = false;
|
||||
|
||||
|
||||
// a lambda makes it easy to capture what we have to change
|
||||
auto next_step = [&](size_t x, size_t y) -> bool {
|
||||
target = $paths[y][x];
|
||||
// don't go through walls
|
||||
// BUG: should actually do a collision check
|
||||
// BUG: can I shortcut if target == 0 now?
|
||||
if(target == WALL_PATH_LIMIT) return false;
|
||||
|
||||
int weight = cur - target;
|
||||
|
|
@ -104,6 +109,7 @@ PathingResult Pathing::find_path(Point &out, int direction, bool diag)
|
|||
|
||||
|
||||
if(diag) {
|
||||
// BUG: maybe a special alternative to box that doesn't do the central cell?
|
||||
for(matrix::box it{$paths, out.x, out.y, 1}; it.next();) {
|
||||
bool should_stop = next_step(it.x, it.y);
|
||||
if(should_stop) break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue