Zone creatures (casues slowdown)
This commit is contained in:
@@ -33,7 +33,7 @@ updatePressedButtons subinv pkeys w = case subinv of
|
||||
| otherwise -> updatePressedButtons' pkeys w
|
||||
CombineInventory mi
|
||||
| pkeys ^? ix ButtonLeft == Just False
|
||||
-> (maybeexitcombine $ maybe id doCombine mi w) & hammers . ix SubInvHam .~ HammerDown
|
||||
-> maybeexitcombine (maybe id doCombine mi w) & hammers . ix SubInvHam .~ HammerDown
|
||||
DisplayTerminal tmid
|
||||
| pkeys ^? ix ButtonLeft == Just False && inTermFocus w
|
||||
-> doTerminalEffectLB (w ^?! terminals . ix tmid) w
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
{-# LANGUAGE TupleSections #-}
|
||||
--{-# LANGUAGE TupleSections #-}
|
||||
{- |
|
||||
Find which objects lie upon a line.
|
||||
-}
|
||||
module Dodge.WorldEvent.ThingsHit
|
||||
( thingsHit
|
||||
-- , wallsHit
|
||||
, thingHit
|
||||
, thingsHitExceptCr
|
||||
)
|
||||
@@ -14,7 +13,7 @@ import Dodge.Base
|
||||
import Dodge.Zone
|
||||
import Geometry
|
||||
|
||||
import Data.Maybe
|
||||
--import Data.Maybe
|
||||
import Data.Bifunctor
|
||||
import StreamingHelp
|
||||
import qualified Streaming.Prelude as S
|
||||
@@ -33,9 +32,7 @@ crsHit :: Point2 -> Point2 -> World -> StreamOf (Point2, Creature)
|
||||
crsHit sp ep
|
||||
| sp == ep = const mempty
|
||||
| otherwise = sortStreamOn (dist sp . fst)
|
||||
. S.mapMaybe
|
||||
(\cr -> (, cr) <$> listToMaybe (intersectCircSeg (_crPos cr) (_crRad cr) sp ep))
|
||||
-- . S.each . _creatures
|
||||
. overlap1SegCrs sp ep
|
||||
. crsNearSeg sp ep
|
||||
|
||||
thingHit :: Point2 -> Point2 -> World -> Maybe (Point2, Either Creature Wall)
|
||||
|
||||
Reference in New Issue
Block a user