Use Item as argument in lUse rather than Int

This commit is contained in:
2022-05-23 13:32:29 +01:00
parent 361dba88a0
commit a870457f2a
6 changed files with 25 additions and 22 deletions
+2 -1
View File
@@ -74,8 +74,9 @@ useLeftItem cid w
| itmShouldBeUsed = useItem cr w
| otherwise = fromMaybe w $ do
invid <- _crLeftInvSel cr
itm <- cr ^? crInv . ix invid
f <- cr ^? crInv . ix invid . itUse . lUse
return $ f cr invid w
return $ f itm cr w
where
cr = _creatures w IM.! cid
itmShouldBeUsed = isJust (cr ^? crInv . ix (_crInvSel cr) . itUse . cUse)