diff options
author | Guillaume Pasquet <guillaume.pasquet@plentific.com> | 2020-03-09 21:55:45 +0000 |
---|---|---|
committer | Guillaume Pasquet <guillaume.pasquet@plentific.com> | 2020-03-09 21:55:45 +0000 |
commit | 7074a8c0075fd89f1d6a8376025b292702aac9f3 (patch) | |
tree | 1130c7eb744e2dac5ca73bea2f1eaaa495a7d80a | |
parent | bcb72351df57b0bee8e080875287d81a37804153 (diff) |
Fix LOS
-rw-r--r-- | src/tiling.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/tiling.rs b/src/tiling.rs index a48d57e..c121eb4 100644 --- a/src/tiling.rs +++ b/src/tiling.rs @@ -130,10 +130,6 @@ impl TileGrid { self.reveal(start.0, start.1); loop { - if let TileType::Empty = self.tile_at(x, y).get_type() { - break; - } - if x == end.0 && y == end.1 { // self.reveal(x, y); break; @@ -148,6 +144,11 @@ impl TileGrid { err += dx; y = (y as isize + sy).max(0) as usize; } + + if let TileType::Empty = self.tile_at(x, y).get_type() { + break; + } + self.reveal(x, y); } } |