Remove Either construct over invAdj

This commit is contained in:
2024-10-26 15:03:45 +01:00
parent 6402ab11da
commit 53557965d0
4 changed files with 8 additions and 15 deletions
+1 -3
View File
@@ -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