More nesting of fields in CWorld

This commit is contained in:
2022-08-19 11:41:07 +01:00
parent 3b7841677a
commit 2e34481ab1
9 changed files with 58 additions and 40 deletions
+3 -3
View File
@@ -20,7 +20,7 @@ useL lu = case lu of
LBoost -> boostSelfL 10
useRewindGun :: Item -> Creature -> World -> World
useRewindGun _ _ w = case _rewindWorlds (_cWorld w) of
useRewindGun _ _ w = case w ^. cWorld . cwTime . rewindWorlds of
[w'] -> rewindusing w' [w']
(w' : ws) -> rewindusing w' ws
_ -> w
@@ -28,10 +28,10 @@ useRewindGun _ _ w = case _rewindWorlds (_cWorld w) of
rewindusing :: CWorld -> [CWorld] -> World
rewindusing w' ws =
w
& cWorld . maybeWorld
& cWorld . cwTime . maybeWorld
.~ Just'
( w'
& rewindWorlds .~ ws
& cwTime . rewindWorlds .~ ws
)
-- be careful changing this around; potential problems include updating the