Remove Either construct over invAdj
This commit is contained in:
@@ -27,9 +27,7 @@ tryGetRootAttachedFromInvID invid im = do
|
||||
-- location ids
|
||||
tryGetRootItemInvID :: Int -> Creature -> Maybe Int
|
||||
tryGetRootItemInvID i cr = do
|
||||
let adj = case invAdj (_crInv cr) of
|
||||
Left str -> error $ "tryToGetRootItemInvID: " ++ str
|
||||
Right x -> x
|
||||
let adj = invAdj (_crInv cr)
|
||||
theroot <- adj ^? ix i
|
||||
theroot ^? _1 . _Just . _1 <|> Just i
|
||||
|
||||
|
||||
Reference in New Issue
Block a user