Combine Door and AutoDoor type constructors, add doorPathable field

This commit is contained in:
jgk
2021-03-21 13:33:57 +01:00
parent 8108772894
commit a34c578786
6 changed files with 8 additions and 22 deletions
+1 -3
View File
@@ -386,9 +386,7 @@ collidePointWalkable p1 p2 ws = any (isJust
. ( \(x:y:_) -> intersectSegSeg' p1 p2 x y)
. _wlLine
) unwalkableWalls
where unwalkableWalls = IM.filter notDoor ws
notDoor (AutoDoor {}) = False
notDoor _ = True
where unwalkableWalls = IM.filter (fromMaybe True . (^? doorPathable)) ws
furthestPointWalkable :: Point2 -> Point2 -> IM.IntMap Wall -> Point2
furthestPointWalkable p1 p2 ws = head $ (sortBy (compare `on` dist p1) $ IM.elems