From 86b10d02c893137cb55a0ea687569a06f7a0bd48 Mon Sep 17 00:00:00 2001 From: justin Date: Fri, 20 Jun 2025 18:02:33 +0100 Subject: [PATCH] Cleanup --- src/Dodge/Inventory/Path.hs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Dodge/Inventory/Path.hs b/src/Dodge/Inventory/Path.hs index d939fa27e..7c747d5b4 100644 --- a/src/Dodge/Inventory/Path.hs +++ b/src/Dodge/Inventory/Path.hs @@ -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