diff --git a/src/Dodge/Update.hs b/src/Dodge/Update.hs index 44a59c22e..3d8d686ff 100644 --- a/src/Dodge/Update.hs +++ b/src/Dodge/Update.hs @@ -359,12 +359,12 @@ muzzleWallCheck w cr = fromMaybe cr $ do if null vs then cr else - let v = minimumBy (compare `on` norm) vs - in cr & crPos . _xy +~ normalize v + let (_,wl) = minimumBy (compare `on` norm . fst) vs + in cr & crPos . _xy +~ signorm (vNormal (uncurry (-) (wl ^. wlLine))) where f loc = map (muzzlePos loc cr) (itemMuzzles loc) g cp wls p = case collidePoint cp p wls of - (ep, Just _) -> Just (ep - p) + (ep, Just wl) -> Just (ep - p, wl) _ -> Nothing updateCreatureStrides :: World -> World