Refactor crPos to be a V3
This commit is contained in:
@@ -6,6 +6,7 @@ module Dodge.Inventory.Add (
|
||||
pickUpItemAt,
|
||||
) where
|
||||
|
||||
import Linear
|
||||
import qualified Data.IntSet as IS
|
||||
import Control.Lens
|
||||
import Control.Monad
|
||||
@@ -61,7 +62,7 @@ createItemYou :: Item -> World -> World
|
||||
createItemYou itm w = maybe w' snd $ tryPutItemInInv 0 itid w'
|
||||
where
|
||||
itid = IM.newKey $ w ^. cWorld . lWorld . items
|
||||
pos = w ^?! cWorld . lWorld . creatures . ix 0 . crPos
|
||||
pos = w ^?! cWorld . lWorld . creatures . ix 0 . crPos . _xy
|
||||
w' = copyItemToFloor pos (itm & itID .~ NInt itid) w
|
||||
|
||||
-- the duplication is annoying...
|
||||
|
||||
Reference in New Issue
Block a user