Use NewIntMap InvInt for crInv
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
module Dodge.Inventory.Path (getInventoryPath) where
|
||||
|
||||
import NewInt
|
||||
import Dodge.Data.Creature
|
||||
import qualified Data.IntMap.Strict as IM
|
||||
import Control.Lens
|
||||
@@ -9,10 +10,10 @@ getInventoryPath :: Int -> InventoryPathing -> Int -> Creature -> Maybe Int
|
||||
getInventoryPath x ip itid cr = case ip of
|
||||
ABSOLUTE -> checkinvid x
|
||||
RELCURS -> do
|
||||
selid <- cr ^? crManipulation . manObject . imSelectedItem
|
||||
selid <- cr ^? crManipulation . manObject . imSelectedItem . unNInt
|
||||
checkinvid (x + selid)
|
||||
RELITEM -> checkinvid (itid + x)
|
||||
where
|
||||
checkinvid y = do
|
||||
guard $ y `IM.member` (cr ^. crInv)
|
||||
guard $ y `IM.member` (cr ^. crInv . unNIntMap)
|
||||
return y
|
||||
|
||||
Reference in New Issue
Block a user