Improve door crushing

This commit is contained in:
2026-03-26 19:21:10 +00:00
parent 31d7a00ecf
commit 01b765300e
10 changed files with 107 additions and 87 deletions
+2 -1
View File
@@ -5,6 +5,7 @@ module Dodge.Creature.Action.Blink (
unsafeBlinkAction,
) where
import qualified Data.IntMap.Strict as IM
import Linear
import Dodge.Creature.Radius
import Dodge.Zoning.Wall
@@ -34,7 +35,7 @@ blinkActionMousePos cr w =
p1 = w ^. cWorld . lWorld . lAimPos
cpos = cr ^. crPos . _xy
--p2 = bouncePoint (const True) 1 cpos p1 w
p2 = pushIntoMaybe $ collideCircWalls cpos p1 r (wlsNearSeg cpos p1 w)
p2 = pushIntoMaybe $ collideCircWalls cpos p1 r (IM.elems $ wlsNearSeg cpos p1 w)
r = crRad $ cr ^. crType
p3 = maybe p1 ((+.+ squashNormalizeV (cpos -.- p1)) . fst) p2
--p3 = maybe p1 (const 0) p2