Clarify when crOldPos is set

This commit is contained in:
2022-05-18 11:26:47 +01:00
parent 8ad33d2f8b
commit 914cae8212
4 changed files with 16 additions and 19 deletions
+6 -7
View File
@@ -2,7 +2,6 @@
module Dodge.WallCreatureCollisions
( colCrsWalls
, colCrWall
, colCrWall'
, pushCreatureOutFromWalls
, crOnWall
) where
@@ -20,16 +19,16 @@ import Control.Lens
import qualified Data.IntMap.Strict as IM
colCrsWalls :: Configuration -> World -> World
colCrsWalls cfig w = w & creatures %~ fmap (colCrWall cfig w)
colCrsWalls cfig w = w & creatures %~ fmap (noclipCheck cfig w)
colCrWall :: Configuration -> World -> Creature -> Creature
colCrWall cfig w c
noclipCheck :: Configuration -> World -> Creature -> Creature
noclipCheck cfig w c
| _debug_noclip cfig && _crID c == 0 = c -- for noclip
| otherwise = colCrWall' w c
| otherwise = colCrWall w c
-- no noclip check, so no need for a configuration file
colCrWall' :: World -> Creature -> Creature
colCrWall' w c
colCrWall :: World -> Creature -> Creature
colCrWall w c
| p1 == p2 = pushOrCrush ls c
-- | _crPos c' == _crPos c'' = c'
-- | otherwise = c & crPos .~ _crOldPos c