Refactor crPos to be a V3
This commit is contained in:
@@ -15,6 +15,7 @@ module Dodge.WorldEvent.ThingsHit (
|
||||
crWlPbHit,
|
||||
) where
|
||||
|
||||
import Linear
|
||||
import Dodge.Data.Object
|
||||
import Dodge.Creature.Radius
|
||||
import Control.Monad
|
||||
@@ -148,6 +149,6 @@ crsHitRadial :: Point2 -> Float -> World -> [(Point2, Creature)]
|
||||
crsHitRadial p r = mapMaybe f . crsNearCirc p r
|
||||
where
|
||||
f cr = do
|
||||
let cp = _crPos cr
|
||||
let cp = cr ^. crPos . _xy
|
||||
guard $ dist p cp < r + crRad (_crType cr)
|
||||
return (cp + (1 + crRad (_crType cr)) *.* (cp - p), cr)
|
||||
|
||||
Reference in New Issue
Block a user