diff --git a/src/Dodge/Creature/YourControl.hs b/src/Dodge/Creature/YourControl.hs index e09016768..525ff19b0 100644 --- a/src/Dodge/Creature/YourControl.hs +++ b/src/Dodge/Creature/YourControl.hs @@ -73,7 +73,8 @@ wasdDir = foldr ((+.+) . wasdM) (V2 0 0) . _keys {- | Set posture according to mouse presses. -} mouseActionsCr :: M.Map SDL.MouseButton Bool -> Creature -> Creature mouseActionsCr pkeys cr - | rbPressed = cr & crStance . posture .~ Aiming + | rbPressed && cr ^?! crInvSel . iselAction == NoInvSelAction + = cr & crStance . posture .~ Aiming | otherwise = cr & crStance . posture .~ AtEase where rbPressed = SDL.ButtonRight `M.member` pkeys diff --git a/src/Dodge/Data/LoadAction.hs b/src/Dodge/Data/LoadAction.hs index 347b408fb..e9734ddab 100644 --- a/src/Dodge/Data/LoadAction.hs +++ b/src/Dodge/Data/LoadAction.hs @@ -14,6 +14,7 @@ data InvSel = InvSel {_iselPos :: Int, _iselAction :: InvSelAction } data InvSelAction = NoInvSelAction | ReloadAction { _actionProgress :: Int, _reloadAction :: LoadAction, _actionHammer :: HammerType} + deriving (Eq,Ord,Show) makeLenses ''LoadAction makeLenses ''InvSel makeLenses ''InvSelAction diff --git a/src/Dodge/Reloading.hs b/src/Dodge/Reloading.hs index a134fe820..2f80b6348 100644 --- a/src/Dodge/Reloading.hs +++ b/src/Dodge/Reloading.hs @@ -50,6 +50,7 @@ tryStartLoading cr = case ic ^? laProgress . _Just . ix 0 of Nothing -> case ic ^? laCycle of Nothing -> cr Just [] -> error ("item has empty load cycle" ++ show (cr ^?! crInv . ix (crSel cr) . itType)) + Just _ | _laLoaded ic >= _laMax ic -> cr Just (la:las) -> cr & startLoadAction la & crInv . ix (crSel cr) . itConsumption . laProgress ?~ (la:las) where