Fix cursor selection when dropping filtered items
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
module Dodge.Inventory.CheckSlots where
|
||||
module Dodge.Inventory.CheckSlots (
|
||||
checkInvSlotsYou,
|
||||
crNumFreeSlots,
|
||||
crInvSize,
|
||||
) where
|
||||
|
||||
import Control.Lens
|
||||
import Data.Maybe
|
||||
@@ -13,11 +17,10 @@ import qualified IntMapHelp as IM
|
||||
checkInvSlotsYou :: Item -> World -> Maybe Int
|
||||
checkInvSlotsYou it w
|
||||
| crNumFreeSlots ycr >= ceiling (_itInvSize it) =
|
||||
Just $ findItemSlot it inv
|
||||
Just $ findItemSlot it (_crInv ycr)
|
||||
| otherwise = Nothing
|
||||
where
|
||||
ycr = you w
|
||||
inv = _crInv ycr
|
||||
|
||||
-- Assumes that the item is singular.
|
||||
-- Do not want to stack floor items for now
|
||||
|
||||
Reference in New Issue
Block a user