Allow to equip left click items
This commit is contained in:
@@ -223,7 +223,12 @@ dropUnselected cr w = foldr (dropItem cr) w . IM.keys
|
||||
$ _crInvSel cr `IM.delete` _crInv cr
|
||||
|
||||
dropItem :: Creature -> Int -> World -> World
|
||||
dropItem cr invid = rmInvItem (_crID cr) invid . copyInvItemToFloor cr invid
|
||||
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
|
||||
|
||||
{- | Get your creature to drop the item under the cursor. -}
|
||||
youDropItem :: World -> World
|
||||
|
||||
Reference in New Issue
Block a user