Simpler check for open doors
This commit is contained in:
+1
-6
@@ -106,12 +106,7 @@ pub struct Wall {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Wall {
|
impl Wall {
|
||||||
pub fn new(
|
pub fn new(p1: Point, p2: Point, door_type: DoorType, door_state: DoorState) -> Self {
|
||||||
p1: Point,
|
|
||||||
p2: Point,
|
|
||||||
door_type: DoorType,
|
|
||||||
door_state: DoorState,
|
|
||||||
) -> Self {
|
|
||||||
Self {
|
Self {
|
||||||
p1,
|
p1,
|
||||||
p2,
|
p2,
|
||||||
|
|||||||
@@ -156,6 +156,10 @@ impl Pathfinder {
|
|||||||
let mut endpoints = FxHashMap::<Point, Vec<f64>>::default();
|
let mut endpoints = FxHashMap::<Point, Vec<f64>>::default();
|
||||||
let mut line_segments = Vec::new();
|
let mut line_segments = Vec::new();
|
||||||
for wall in walls {
|
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 x_diff = wall.p2.x - wall.p1.x;
|
||||||
let y_diff = wall.p2.y - wall.p1.y;
|
let y_diff = wall.p2.y - wall.p1.y;
|
||||||
let p1_angle = y_diff.atan2(x_diff);
|
let p1_angle = y_diff.atan2(x_diff);
|
||||||
|
|||||||
Reference in New Issue
Block a user