From da83bd06a6e7b7fccec61e3b9d3c4105ced25a22 Mon Sep 17 00:00:00 2001 From: justin Date: Fri, 19 Nov 2021 00:45:45 +0000 Subject: [PATCH] Tweak wall collisions --- src/Dodge/WallCreatureCollisions.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Dodge/WallCreatureCollisions.hs b/src/Dodge/WallCreatureCollisions.hs index 01fc499ce..d8fabb532 100644 --- a/src/Dodge/WallCreatureCollisions.hs +++ b/src/Dodge/WallCreatureCollisions.hs @@ -23,11 +23,14 @@ colCrWall :: World -> Creature -> Creature colCrWall w c | noclipIsOn && _crID c == 0 = c -- for noclip | p1 == p2 = pushOrCrush ls c - | otherwise = c & crPos %~ + | _crPos c' == _crPos c'' = c' + | otherwise = c & crPos .~ _crOldPos c + where + c'' = c & crPos %~ pushOutFromWalls rad ls + c' = c & crPos %~ pushOutFromWalls rad (reverse ls) . pushOutFromWalls rad ls . flip (collidePointWalls p1) wls -- check push throughs - where rad = _crRad c + wallBuffer p1 = _crOldPos c p2 = _crPos c