Add fields to determine an item's inventory position/whether it is held

This commit is contained in:
2022-04-11 13:32:06 +01:00
parent d46d315203
commit c686d9e111
14 changed files with 107 additions and 113 deletions
+5 -1
View File
@@ -217,7 +217,11 @@ youDropItem' w = case yourItem w ^? _Just . itCurseStatus of
cr = you w
{- | Copy an inventory item to the floor. -}
copyInvItemToFloor :: Creature -> Int -> World -> World
copyInvItemToFloor cr i = copyItemToFloor (_crPos cr) (_crInv cr IM.! i)
copyInvItemToFloor cr i = copyItemToFloor (_crPos cr)
(_crInv cr IM.! i
& itInvPos .~ Nothing
& itIsHeld .~ False
)
sizeSelf :: Float -> Creature -> World -> Maybe World