Fix inventory swapping equipment bug
This commit is contained in:
@@ -28,7 +28,7 @@ crMvAbsolute p' cr = advanceStepCounter (magV p) cr
|
||||
strengthFactor :: Int -> Float
|
||||
strengthFactor i
|
||||
| i > 9 = 1
|
||||
| i < 1 = 0.1
|
||||
| i < 1 = 0
|
||||
| otherwise = 0.1 * fromIntegral i
|
||||
|
||||
crMvForward
|
||||
|
||||
@@ -71,11 +71,13 @@ eqSiteToPos cr es = case es of
|
||||
useLeftItem :: Int -> World -> World
|
||||
useLeftItem cid w
|
||||
| _crInvLock cr = w
|
||||
| itConsumable = useItem cr w
|
||||
| itmShouldBeUsed = useItem cr w
|
||||
| otherwise = fromMaybe w $ do
|
||||
invid <- _crLeftInvSel cr
|
||||
f <- cr ^? crInv . ix invid . itUse . lUse
|
||||
return $ f cr invid w
|
||||
where
|
||||
cr = _creatures w IM.! cid
|
||||
itConsumable = isJust $ cr ^? crInv . ix (_crInvSel cr) . itUse . cUse
|
||||
itmShouldBeUsed = isJust (cr ^? crInv . ix (_crInvSel cr) . itUse . cUse)
|
||||
|| isJust (cr ^? crInv . ix (_crInvSel cr) . itUse . eqUse)
|
||||
-- TODO determine itmShouldBeUsed with reference to config options
|
||||
|
||||
Reference in New Issue
Block a user