Fix at least one bug from item refactor, more remain

This commit is contained in:
2025-08-24 21:01:02 +01:00
parent 94f6d5c630
commit c2daa86463
19 changed files with 95 additions and 95 deletions
+2 -2
View File
@@ -111,11 +111,11 @@ tryPutItemInInvAt i cid itid w = do
-- return (Just i, w')
createItemYou :: Item -> World -> World
createItemYou itm w = fromMaybe w' $ fmap snd $ tryPutItemInInv 0 itid w'
createItemYou itm w = w' -- fromMaybe w' $ fmap snd $ tryPutItemInInv 0 itid w'
where
itid = IM.newKey $ w ^. cWorld . lWorld . items
pos = w ^?! cWorld . lWorld . creatures . ix 0 . crPos
w' = copyItemToFloorID pos (itm & itID .~ NInt itid) w
w' = copyItemToFloor pos (itm & itID .~ NInt itid) w
-- | Pick up a specific item.
pickUpItem :: Int -> Int -> World -> World