This commit is contained in:
2024-09-26 16:32:07 +01:00
parent 772886c8c6
commit fb6fcff61c
9 changed files with 59 additions and 192 deletions
+2 -2
View File
@@ -20,7 +20,7 @@ import Control.Applicative
-- assumes all item locations inside the items are correct
tryGetRootAttachedFromInvID :: Int -> IM.IntMap Item -> Maybe (Int, IS.IntSet)
tryGetRootAttachedFromInvID invid im = do
let imroots = invRootMap' im
let imroots = invRootMap im
theroot = fromMaybe invid $ imroots ^? ix invid . _1 . _Just
t <- imroots ^? ix theroot . _2
--return (theroot, foldMap (IS.singleton . (^?! _1 . itLocation . ilInvID)) t)
@@ -31,7 +31,7 @@ tryGetRootAttachedFromInvID invid im = do
-- location ids
tryGetRootItemInvID :: Int -> Creature -> Maybe Int
tryGetRootItemInvID i cr = do
let adj = case invAdj' (_crInv cr) of
let adj = case invAdj (_crInv cr) of
Left str -> error $ "tryToGetRootItemInvID: "++ str
Right x -> x
theroot <- adj ^? ix i