Fix inventory swapping equipment bug
This commit is contained in:
@@ -210,12 +210,13 @@ dropExcept cr invid w = foldr (dropItem cr) w . IM.keys
|
||||
$ invid `IM.delete` _crInv cr
|
||||
|
||||
dropItem :: Creature -> Int -> World -> World
|
||||
dropItem cr invid = rmInvItem cid invid . copyInvItemToFloor cr invid . mayberemoveequip
|
||||
dropItem cr invid = rmInvItem cid invid . copyInvItemToFloor cr invid -- . mayberemoveequip
|
||||
where
|
||||
cid = _crID cr
|
||||
mayberemoveequip = case _crLeftInvSel cr of
|
||||
Just i | i == invid -> creatures . ix cid . crLeftInvSel .~ Nothing
|
||||
_ -> id
|
||||
-- the following should be done in rmInvItem
|
||||
-- mayberemoveequip = case _crLeftInvSel cr of
|
||||
-- Just i | i == invid -> creatures . ix cid . crLeftInvSel .~ Nothing
|
||||
-- _ -> id
|
||||
|
||||
youDropItem :: World -> World
|
||||
youDropItem w
|
||||
@@ -239,7 +240,6 @@ copyInvItemToFloor cr i = copyItemToFloor (_crPos cr)
|
||||
& itIsHeld .~ False
|
||||
)
|
||||
|
||||
|
||||
sizeSelf :: Float -> Creature -> World -> Maybe World
|
||||
sizeSelf x cr w
|
||||
-- | _crPos cr1 == _crPos cr2 = Just $ w
|
||||
|
||||
Reference in New Issue
Block a user