Improve item location code, including some error detection
This commit is contained in:
@@ -18,16 +18,6 @@ import Dodge.FloorItem
|
||||
import Dodge.Inventory.CheckSlots
|
||||
import qualified IntMapHelp as IM
|
||||
|
||||
--putItemInInvID :: Int -> Int -> World -> (Maybe Int, World)
|
||||
--putItemInInvID cid flid w = fromMaybe (Nothing, w) $ do
|
||||
-- flit <- w ^? cWorld . lWorld . floorItems . ix flid
|
||||
-- (i, w') <- tryPutItemInInv cid flit w
|
||||
-- return (Just i, w')
|
||||
|
||||
--putItemInInvSlot :: Int -> Item -> IM.IntMap Item -> IM.IntMap Item
|
||||
--putItemInInvSlot = IM.insert
|
||||
----putItemInInvSlot = IM.insertWith (const $ itUse . useAmount +~ 1)
|
||||
|
||||
tryPutItemIDInInv :: Int -> Int -> World -> Maybe (Int, World)
|
||||
tryPutItemIDInInv cid flitid w = do
|
||||
flit <- w ^? cWorld . lWorld . floorItems . ix flitid
|
||||
|
||||
Reference in New Issue
Block a user