Allow to equip left click items

This commit is contained in:
2021-11-27 02:01:12 +00:00
parent 774808663a
commit e7ea7377e2
21 changed files with 93 additions and 116 deletions
+6 -1
View File
@@ -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