Make use hammers and item positions slightly more logical
This commit is contained in:
@@ -5,6 +5,7 @@ module Dodge.Creature.Impulse.UseItem
|
||||
import Dodge.Data
|
||||
import Dodge.Inventory
|
||||
import Dodge.Reloading
|
||||
import Dodge.Item.Location
|
||||
|
||||
import qualified Data.IntMap.Strict as IM
|
||||
import qualified Data.Map.Strict as M
|
||||
@@ -43,7 +44,9 @@ tryClickReload :: Creature -> Item -> World -> (World -> World) -> World -> Worl
|
||||
tryClickReload cr it w f
|
||||
| _crID cr == _yourID w && itNeedsLoading it && _mouseButtons w M.!? SDL.ButtonLeft == Just False
|
||||
= crToggleReloading cr
|
||||
| otherwise = f
|
||||
| otherwise =
|
||||
(runIdentity . pointToItem (_itPos it) (return . (itUse . useHammer' .~ HammerDown)))
|
||||
. f
|
||||
|
||||
itNeedsLoading :: Item -> Bool
|
||||
itNeedsLoading it = _laLoaded ic == 0 || not (_laPrimed ic)
|
||||
|
||||
Reference in New Issue
Block a user