Only display combinations for first items in list
This commit is contained in:
@@ -21,7 +21,8 @@ putItemInInvID cid flid w = fromMaybe (Nothing, w) $ do
|
||||
return (Just i, w')
|
||||
|
||||
putItemInInvSlot :: Int -> Item -> IM.IntMap Item -> IM.IntMap Item
|
||||
putItemInInvSlot = IM.insertWith (const $ itUse . useAmount +~ 1)
|
||||
putItemInInvSlot = IM.insert
|
||||
--putItemInInvSlot = IM.insertWith (const $ itUse . useAmount +~ 1)
|
||||
|
||||
-- | Pick up a specific item.
|
||||
tryPutItemInInv :: Int -> FloorItem -> World -> Maybe (Int, World)
|
||||
|
||||
@@ -25,12 +25,13 @@ checkInvSlotsYou it w
|
||||
-- Assumes that the item is singular.
|
||||
-- Do not want to stack floor items for now
|
||||
findItemSlot :: Item -> IM.IntMap Item -> Int
|
||||
findItemSlot it inv = case it ^? itUse . useAmount of
|
||||
Just _ ->
|
||||
fromMaybe newslot $ IM.findIndex (\it' -> _itType it == _itType it') inv
|
||||
_ -> newslot
|
||||
where
|
||||
newslot = maybe 0 ((+ 1) . fst) $ IM.lookupMax inv
|
||||
findItemSlot it inv = maybe 0 ((+ 1) . fst) $ IM.lookupMax inv
|
||||
--findItemSlot it inv = case it ^? itUse . useAmount of
|
||||
-- Just _ ->
|
||||
-- fromMaybe newslot $ IM.findIndex (\it' -> _itType it == _itType it') inv
|
||||
-- _ -> newslot
|
||||
-- where
|
||||
-- newslot = maybe 0 ((+ 1) . fst) $ IM.lookupMax inv
|
||||
|
||||
crNumFreeSlots :: Creature -> Int
|
||||
crNumFreeSlots cr = _crInvCapacity cr - invSize (_crInv cr)
|
||||
|
||||
Reference in New Issue
Block a user