Distinguish between selected item and root-selected item
This commit is contained in:
@@ -192,7 +192,7 @@ dropItem cr invid = rmInvItem (_crID cr) invid . copyInvItemToFloor cr invid --
|
||||
youDropItem :: World -> World
|
||||
youDropItem w = fromMaybe w $ do
|
||||
curpos <-
|
||||
you w ^? crManipulation . manObject . inInventory . ispItem
|
||||
you w ^? crManipulation . manObject . inInventory . imSelectedItem
|
||||
<|> fmap fst (IM.lookupMax =<< w ^? hud . hudElement . diSections . sssSections . ix 0 . ssItems)
|
||||
guard $ not $ _crInvLock (you w) || cursed
|
||||
return $
|
||||
@@ -202,7 +202,7 @@ youDropItem w = fromMaybe w $ do
|
||||
where
|
||||
cr = you w
|
||||
cursed = fromMaybe False $ do
|
||||
it <- yourItem w
|
||||
it <- yourSelectedItem w
|
||||
return $ it ^. itCurseStatus /= Uncursed
|
||||
|
||||
-- | Copy an inventory item to the floor.
|
||||
@@ -210,7 +210,8 @@ copyInvItemToFloor :: Creature -> Int -> World -> World
|
||||
copyInvItemToFloor cr i =
|
||||
copyItemToFloor (_crPos cr) $
|
||||
_crInv cr IM.! i
|
||||
& itIsHeld .~ False
|
||||
& itIsSelected .~ False
|
||||
& itIsRoot .~ False
|
||||
|
||||
sizeSelf :: Float -> Creature -> World -> Maybe World
|
||||
sizeSelf x cr w
|
||||
|
||||
Reference in New Issue
Block a user