Simplify doors somewhat, unsure what to do about edge obstacles

This commit is contained in:
2025-10-22 23:09:09 +01:00
parent 0fd7ba46b5
commit 9e6534b8f4
7 changed files with 26 additions and 38 deletions
+3 -2
View File
@@ -7,6 +7,7 @@ module Dodge.Block.Debris (
makeDebrisDirected,
) where
import qualified Data.IntMap.Strict as IM
import Dodge.ShiftPoint
import Color
import Data.Foldable
@@ -28,8 +29,8 @@ makeDoorDebris dr w = w & makeDebris mt col p
p2a = lerpP2A (dr ^. drZeroPos) (dr ^. drOnePos) (dr ^. drLerp)
p = centroid . fmap fst $ (dr ^. drFootPrint) & each . each %~ shiftPointBy p2a
(mt, col) = fromMaybe (Stone, greyN 0.5) $ do
wlids <- w ^? cWorld . lWorld . doors . ix (_drID dr) . drWallIDs
(wlid, _) <- IS.minView wlids
wlids <- w ^? cWorld . lWorld . doors . ix (_drID dr) . drFootPrint
((wlid,_),_) <- IM.minViewWithKey wlids
wl <- w ^? cWorld . lWorld . walls . ix wlid
return (_wlMaterial wl, _wlColor wl)