diff --git a/src/Dodge/Creature/Impulse/UseItem.hs b/src/Dodge/Creature/Impulse/UseItem.hs index 70b56a719..f30d1a86c 100644 --- a/src/Dodge/Creature/Impulse/UseItem.hs +++ b/src/Dodge/Creature/Impulse/UseItem.hs @@ -31,7 +31,6 @@ itemEffect :: Creature -> Item -> World -> World itemEffect cr it w = case it ^. itUse of HeldUse{_heldUse = eff, _heldMods = usemods} -> hammerTest $ tryReload cr it (_input w) $ foldl' (&) (useHeld eff) (useMod usemods) it cr - --hammerTest $ tryReload cr it w $ foldl' (&) (useHeld eff) (reverse $ useMod usemods) it cr LeftUse{} -> doequipmentchange EquipUse{} -> doequipmentchange -- ConsumeUse will cause problems if the item is not selected diff --git a/src/Dodge/Inventory.hs b/src/Dodge/Inventory.hs index 788a5705a..9827fd492 100644 --- a/src/Dodge/Inventory.hs +++ b/src/Dodge/Inventory.hs @@ -308,7 +308,7 @@ closeObjScrollDir x changeInvSel :: Int -> World -> World changeInvSel i w - | n == 0 = w + | i == 0 || n == 0 = w | yourInvSel w < n = w & pointcrInvSel . iselPos %~ (`mod` n) . subtract i @@ -325,6 +325,7 @@ changeInvSel i w changeSwapInvSel :: Int -> World -> World changeSwapInvSel k w + | k == 0 = w | yourInvSel w < n = w & cWorld . lWorld . creatures . ix 0 %~ updatecreature @@ -356,10 +357,12 @@ changeSwapInvSel k w numCO = length $ w ^. hud . closeObjects changeAugInvSel :: Int -> World -> World -changeAugInvSel i w = - w - & cWorld . lWorld . creatures . ix 0 . crInvSel . iselPos %~ (`mod` n) . subtract i - & cWorld . lWorld . creatures . ix 0 . crInvSel . iselAction .~ NoInvSelAction +changeAugInvSel i w + | i == 0 = w + | otherwise = + w + & cWorld . lWorld . creatures . ix 0 . crInvSel . iselPos %~ (`mod` n) . subtract i + & cWorld . lWorld . creatures . ix 0 . crInvSel . iselAction .~ NoInvSelAction where n = length (yourInv w) + length (w ^. hud . closeObjects) + 1 diff --git a/src/Dodge/Reloading.hs b/src/Dodge/Reloading.hs index f840a2e46..dad0512ff 100644 --- a/src/Dodge/Reloading.hs +++ b/src/Dodge/Reloading.hs @@ -16,7 +16,6 @@ crCancelReloading cr = stepReloading :: Creature -> Creature stepReloading cr = case cr ^?! crInvSel . iselAction of --- ReloadAction _ _ (HasHammer HammerUp) -> cr & crInvSel . iselAction .~ NoInvSelAction ReloadAction x la | x > 0 -> cr & crInvSel . iselAction . actionProgress -~ 1 diff --git a/src/Dodge/TestString.hs b/src/Dodge/TestString.hs index 7a375e812..73648a0a9 100644 --- a/src/Dodge/TestString.hs +++ b/src/Dodge/TestString.hs @@ -9,18 +9,10 @@ import Dodge.Data.Universe --import qualified IntMapHelp as IM testStringInit :: Universe -> [String] testStringInit u = - [ show $ u ^. uvWorld . input . scrollAmount - , maybe mempty show mit - , maybe mempty (show . f) mit - , maybe mempty show mit' - , maybe mempty show mit'' + [ show $ ycr ^?! crInvSel . iselAction ] where - f x = 1/ (x *2) ** (40/39) ycr = you (u ^. uvWorld) - mit = ycr ^? crInv . ix (crSel ycr) . itScope . scopeZoom - mit' = ycr ^? crInv . ix (crSel ycr) . itScope . scopePos - mit'' = ycr ^? crInv . ix (crSel ycr) . itScope . scopeZoomChange showTimeFlow :: TimeFlowStatus -> String showTimeFlow tfs = case tfs of