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