Correctly update root status of item in _ilIsRoot
This commit is contained in:
@@ -17,6 +17,7 @@ import ShapePicture
|
||||
itemEquipPict :: Creature -> LabelDoubleTree ItemLink ComposedItem -> SPic
|
||||
itemEquipPict cr itmtree = case itm ^. itUse of
|
||||
UseHeld{} | itm ^? itLocation . ilIsRoot == Just True
|
||||
&& itm ^? itLocation . ilIsSelected == Just True
|
||||
-> overPosSP (heldItemOffset itm cr) (itemTreeSPic itmtree)
|
||||
ituse -> fromMaybe mempty $ do
|
||||
attachpos <- ituse ^? uequipEffect . eeAttachPos
|
||||
|
||||
@@ -206,7 +206,7 @@ invTrees' = IM.unions . map (ldtToIM getindex . fmap (^. _1)) . map (fmap (\(x,
|
||||
fromMaybe (error "in invTrees try to get non-inventory item tree") $
|
||||
i ^? itLocation . ilInvID
|
||||
|
||||
-- returns an intmap with trees for root items, indexed by inventory position
|
||||
-- returns an intmap with trees for (only!) root items, indexed by inventory position
|
||||
invRootTrees :: IM.IntMap Item -> IM.IntMap (LabelDoubleTree ItemLink ComposedItem)
|
||||
invRootTrees = IM.fromDistinctAscList . reverse . map (getid . fmap (\(x, y, _) -> CItem x y)) . invLDT
|
||||
where
|
||||
|
||||
@@ -41,7 +41,7 @@ pointerYourSelectedItem f w = fromMaybe (pure w) $ do
|
||||
|
||||
pointerYourRootItem :: Applicative a => (Item -> a Item) -> World -> a World
|
||||
pointerYourRootItem f w = fromMaybe (pure w) $ do
|
||||
itinvid <- w ^? cWorld . lWorld . creatures . ix 0 . crManipulation . manObject . imRootItem
|
||||
itinvid <- w ^? cWorld . lWorld . creatures . ix 0 . crManipulation . manObject . imRootSelectedItem
|
||||
Just $ pointerToItemLocation (InInv 0 itinvid True True True) f w
|
||||
|
||||
pointerToItem ::
|
||||
|
||||
Reference in New Issue
Block a user