Correctly reduce left click item delay
This commit is contained in:
@@ -110,7 +110,8 @@ toggleEquipmentAt rbops invid cr w = case rbops ^? opAllocateEquipment of
|
||||
useLeftItem :: Int -> World -> World
|
||||
useLeftItem cid w
|
||||
| _crInvLock cr = w
|
||||
| itmShouldBeUsed = useItem cr w -- I believe this ONLY sets equipment options
|
||||
| itmIsConsumable = useItem cr w -- I believe this ONLY sets equipment options
|
||||
| itmIsEquipable = useItem cr w -- I believe this ONLY sets equipment options
|
||||
| otherwise = fromMaybe w $ do
|
||||
invid <- _crLeftInvSel cr
|
||||
itm <- cr ^? crInv . ix invid
|
||||
@@ -121,9 +122,10 @@ useLeftItem cid w
|
||||
$ w
|
||||
where
|
||||
cr = _creatures (_cWorld w) IM.! cid
|
||||
itmShouldBeUsed =
|
||||
itmIsConsumable =
|
||||
isJust (cr ^? crInv . ix (crSel cr) . itUse . cUse)
|
||||
|| ( isJust (cr ^? crInv . ix (crSel cr) . itUse . equipEffect . eeUse)
|
||||
itmIsEquipable =
|
||||
( isJust (cr ^? crInv . ix (crSel cr) . itUse . equipEffect . eeUse)
|
||||
&& _crLeftInvSel cr /= Just (crSel cr)
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user