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
View File
@@ -72,6 +72,7 @@ functionalUpdate cfig w = checkEndGame
. updateIMl _machines _mcUpdate
. updateIMl _creatures _crUpdate
-- creatures should be updated early so that crOldPos is set before any position change
. over creatures (fmap setOldPos)
. updateCreatureGroups
. updateBlocks
. updateSeenWalls
@@ -85,6 +86,11 @@ functionalUpdate cfig w = checkEndGame
where
(x,y) = cloudZoneOfPoint $ stripZ $ _clPos cl
setOldPos :: Creature -> Creature
setOldPos cr = cr
& crOldPos .~ _crPos cr
& crOldDir .~ _crDir cr
-- hack
--updateRandGen :: World -> World
--updateRandGen = randGen %~ (snd . (uniform :: StdGen -> (Int,StdGen)))