diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-09-14 20:13:30 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-09-14 20:13:30 +0200 |
commit | e624df32f06c42cd44db1bf822603d8749a38406 (patch) | |
tree | 58ccd39a947685d3f4da894c81a0feed4e40d86d /test | |
parent | 303726c2e41d5e1bd3d18f82489646cc11ff902c (diff) |
more tests
Diffstat (limited to 'test')
-rw-r--r-- | test/path-search.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/path-search.cpp b/test/path-search.cpp index ff09a5c9..d58e68b6 100644 --- a/test/path-search.cpp +++ b/test/path-search.cpp @@ -48,6 +48,22 @@ void test_bbox() fm_assert( is_passable(w, coord1, bbox({0, _15}, W)) ); } } + { + using enum rotation; + constexpr auto ch = chunk_coords_{11, 22, 0}; + auto w = world(); + auto& c = w[ch]; + c[{8, 7}].wall_north() = {metal2,0}; + c[{8, 9}].wall_north() = {metal2,0}; + fm_assert( is_passable_1(c, bbox({8, 8}, N)) ); + fm_assert( is_passable_1(c, bbox({8, 8}, E)) ); + fm_assert( !is_passable_1(c, bbox({8, 8}, S)) ); + fm_assert( is_passable_1(c, bbox({8, 8}, W)) ); + + c[{8, 8}].wall_north() = {metal2,0}; + c.mark_passability_modified(); + fm_assert( !is_passable_1(c, bbox({8, 8}, N)) ); + } // todo use test chunk } |