Stop intersectSegSegTest returning True for collinear line pairs
This commit is contained in:
@@ -11,6 +11,7 @@ module Dodge.Room.LasTurret (
|
||||
lasCenRunClose,
|
||||
) where
|
||||
|
||||
import Dodge.Room.Procedural
|
||||
import qualified Data.Set as S
|
||||
import Dodge.Cleat
|
||||
import Dodge.Data.GenWorld
|
||||
@@ -141,8 +142,8 @@ lasCenSensEdge n = do
|
||||
, treePost [door, cleatLabel 0 corridor]
|
||||
]
|
||||
|
||||
lasCenRunClose :: (RandomGen g) => State g (MetaTree Room String)
|
||||
lasCenRunClose = do
|
||||
lasCenRunClose' :: (RandomGen g) => State g (MetaTree Room String)
|
||||
lasCenRunClose' = do
|
||||
thelight <- mntLightLnkCond $ rprBool $ const . isInLnk
|
||||
thelight1 <- mntLightLnkCond $ rprBool $ const . isOutLnk
|
||||
r <-
|
||||
@@ -169,6 +170,31 @@ lasCenRunClose = do
|
||||
inlinkwall = linkwall isInLnk
|
||||
outlinkwall = linkwall isOutLnk
|
||||
|
||||
lasCenRunClose :: (RandomGen g) => State g (MetaTree Room String)
|
||||
lasCenRunClose = do
|
||||
r <-
|
||||
roomRectAutoLights 250 250
|
||||
<&> rmPmnts
|
||||
<>~ [ putLasTurret 0.02 & plSpot .~ PS (V2 220 20) 0
|
||||
, inlinkwall 70 (rectNSWE 10 (-10) (-10) 30)
|
||||
, inlinkwall 125 (rectNSWE 55 (-55) (-10) 10)
|
||||
, inlinkwall 180 (rectNSWE 10 (-10) (-30) 10)
|
||||
, outlinkwall 70 (rectNSWE 10 (-10) (-30) 10)
|
||||
, outlinkwall 125 (rectNSWE 55 (-55) (-10) 10)
|
||||
, outlinkwall 180 (rectNSWE 10 (-10) (-10) 30)
|
||||
]
|
||||
<&> rmLinks %~ setInLinks (memtest (FromEdge West 0) (OnEdge South))
|
||||
<&> rmLinks %~ setOutLinks (memtest (FromEdge East 0) (OnEdge North))
|
||||
rToOnward "lasCenRunClose" $ return $ cleatOnward r
|
||||
where
|
||||
memtest a b x = let y = _rlType x
|
||||
in a `S.member` y && b `S.member` y
|
||||
linkwall f x = heightWallPS
|
||||
(resetPLUse $ rprBoolShift (const . f) (shiftInBy x <&> (,S.singleton UsedPosLow)))
|
||||
30
|
||||
inlinkwall = linkwall isInLnk
|
||||
outlinkwall = linkwall isOutLnk
|
||||
|
||||
lasTunnel :: (RandomGen g) => Float -> State g Room
|
||||
lasTunnel y = do
|
||||
extraPlmnts <-
|
||||
|
||||
Reference in New Issue
Block a user