From ca61ae0c64de1a4cc6f5f68142877ed34d835deb Mon Sep 17 00:00:00 2001 From: justin Date: Mon, 23 Dec 2024 13:16:38 +0000 Subject: [PATCH] Allow for scrolling alteRifle --- src/Dodge/Update/Scroll.hs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Dodge/Update/Scroll.hs b/src/Dodge/Update/Scroll.hs index 8edae84f5..a9d8f7162 100644 --- a/src/Dodge/Update/Scroll.hs +++ b/src/Dodge/Update/Scroll.hs @@ -61,11 +61,14 @@ selectedItemScroll :: Int -> World -> World selectedItemScroll scrollamount w = fromMaybe w $ do i <- you w ^? crManipulation . manObject . imSelectedItem itm <- you w ^? crInv . ix i - return $ itemScroll scrollamount itm w + return $ itemScroll scrollamount i itm w -itemScroll :: Int -> Item -> World -> World -itemScroll yi itm w = case itm ^. itType of +itemScroll :: Int -> Int -> Item -> World -> World +itemScroll yi invid itm w = case itm ^. itType of ATTACH ZOOMSCOPE -> updateScopeZoom w + HELD ALTERIFLE | yi /= 0 -> w + & cWorld . lWorld . creatures . ix 0 . crInv . ix invid + . itUse . heldAim . aimMuzzles . ix 0 . mzAmmoSlot %~ ((`mod` 2) . (+1)) _ -> w -- note that your _crInvLock does not apply to this TODO check that this is what