Rewinding fixes

This commit is contained in:
2022-02-18 11:45:17 +00:00
parent e74ac9f4c4
commit 9923897fe2
4 changed files with 12 additions and 1 deletions
+4 -1
View File
@@ -43,13 +43,16 @@ rewindEffect _ cr invid w
useRewindGun :: Item -> Creature -> World -> World
useRewindGun _ _ w = case _rewindWorlds w of
[w'] -> rewindusing w' []
(w':ws) -> rewindusing w' ws
(_:w':ws) -> rewindusing w' ws
_ -> w
where
rewindusing w' ws = w'
rewindusing w' ws = w
& maybeWorld .~ Just' ( w'
-- & creatures . ix (_crID cr) .~ cr
& upbuts
& rewindWorlds .~ ws
)
upbuts = (keys .~ _keys w) . (mouseButtons .~ _mouseButtons w)
-- needs to shift this item to the current inventory slot