Allow for more complex item composition
This commit is contained in:
@@ -20,10 +20,11 @@ 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)
|
||||
--return (theroot, foldMap (IS.singleton . (^?! _1 . itLocation . ilInvID)) t)
|
||||
return (theroot, foldMap (IS.singleton . (^?! itLocation . ilInvID)) t)
|
||||
|
||||
|
||||
-- this assumes the creature inventory is well formed, specifically the
|
||||
|
||||
Reference in New Issue
Block a user