Add newtype for item id int
This commit is contained in:
@@ -48,7 +48,7 @@ tryPutItemInInv cid flit w = case maybeInvSlot of
|
||||
it = _flIt flit
|
||||
maybeInvSlot = checkInvSlotsYou it w
|
||||
-- not sure if the following is necessary
|
||||
updateItLocation invid w' = w' & cWorld . lWorld . itemLocations . ix (_itID it)
|
||||
updateItLocation invid w' = w' & cWorld . lWorld . itemLocations . ix (_unNInt $ _itID it)
|
||||
.~ InInv
|
||||
{_ilCrID = cid
|
||||
, _ilInvID = invid
|
||||
@@ -82,7 +82,7 @@ createItemYou itm w = fromMaybe (OnFloor flid, w') $ do
|
||||
where
|
||||
itid = IM.newKey $ w ^. cWorld . lWorld . itemLocations
|
||||
pos = w ^?! cWorld . lWorld . creatures . ix 0 . crPos
|
||||
(flid,w') = copyItemToFloorID pos (itm & itID .~ itid) w
|
||||
(flid,w') = copyItemToFloorID pos (itm & itID .~ NInt itid) w
|
||||
|
||||
|
||||
-- | Pick up a specific item.
|
||||
|
||||
Reference in New Issue
Block a user