Cleanup
This commit is contained in:
@@ -7,12 +7,12 @@ import Control.Monad
|
|||||||
|
|
||||||
getInventoryPath :: Int -> InventoryPathing -> Int -> Creature -> Maybe Int
|
getInventoryPath :: Int -> InventoryPathing -> Int -> Creature -> Maybe Int
|
||||||
getInventoryPath x ip itid cr = case ip of
|
getInventoryPath x ip itid cr = case ip of
|
||||||
ABSOLUTE | x `IM.member` (cr ^. crInv) -> Just x
|
ABSOLUTE -> checkinvid x
|
||||||
RELCURS -> do
|
RELCURS -> do
|
||||||
selid <- cr ^? crManipulation . manObject . imSelectedItem
|
selid <- cr ^? crManipulation . manObject . imSelectedItem
|
||||||
guard $ (x + selid) `IM.member` (cr ^. crInv)
|
checkinvid (x + selid)
|
||||||
return (x + selid)
|
RELITEM -> checkinvid (itid + x)
|
||||||
RELITEM
|
where
|
||||||
| (itid + x) `IM.member` (cr ^. crInv) ->
|
checkinvid y = do
|
||||||
return $ itid + x
|
guard $ y `IM.member` (cr ^. crInv)
|
||||||
_ -> Nothing
|
return y
|
||||||
|
|||||||
Reference in New Issue
Block a user