From d00b4d1c6f1bf678192931e12e51bea40ae5648e Mon Sep 17 00:00:00 2001 From: justin Date: Mon, 30 Mar 2026 20:30:18 +0100 Subject: [PATCH] Muzzle pushback direction depends only on wall line --- src/Dodge/Update.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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