Simpler check for open doors

This commit is contained in:
Manuel Vögele
2022-02-14 17:20:18 +01:00
parent c11899fb17
commit 2bf52e62dd
2 changed files with 5 additions and 6 deletions
+1 -6
View File
@@ -106,12 +106,7 @@ pub struct Wall {
}
impl Wall {
pub fn new(
p1: Point,
p2: Point,
door_type: DoorType,
door_state: DoorState,
) -> Self {
pub fn new(p1: Point, p2: Point, door_type: DoorType, door_state: DoorState) -> Self {
Self {
p1,
p2,
+4
View File
@@ -156,6 +156,10 @@ impl Pathfinder {
let mut endpoints = FxHashMap::<Point, Vec<f64>>::default();
let mut line_segments = Vec::new();
for wall in walls {
if wall.is_door() && wall.is_open() {
continue;
}
// TODO Check if wall is ethereal
let x_diff = wall.p2.x - wall.p1.x;
let y_diff = wall.p2.y - wall.p1.y;
let p1_angle = y_diff.atan2(x_diff);