Tweak muzzle push out

This commit is contained in:
2026-03-30 21:14:57 +01:00
parent 633bf479b2
commit c66b2fb299
+4 -2
View File
@@ -358,8 +358,10 @@ muzzleWallCheck w cr = fromMaybe cr $ do
if null vs
then cr
else
let (_,wl) = minimumBy (compare `on` norm . fst) vs
in cr & crPos . _xy +~ signorm (vNormal (uncurry (-) (wl ^. wlLine)))
let (v,wl) = minimumBy (compare `on` norm . fst) vs
v' = signorm (vNormal (uncurry (-) (wl ^. wlLine)))
x = dotV v' v
in cr & crPos . _xy +~ min 1 x *^ v'
where
f loc = map (muzzlePos loc cr) (itemMuzzles loc)
g cp wls p = case collidePoint cp p wls of