Add sounds when connecting/disconnecting items
This commit is contained in:
@@ -6,6 +6,7 @@ module Dodge.Inventory.Location (
|
||||
|
||||
import Control.Applicative
|
||||
import Control.Lens
|
||||
import Data.IntMap.Merge.Strict
|
||||
import qualified Data.IntSet as IS
|
||||
import Data.Maybe
|
||||
import Dodge.Base.You
|
||||
@@ -13,7 +14,6 @@ import Dodge.Data.Item.Use.Consumption.LoadAction
|
||||
import Dodge.Data.World
|
||||
import Dodge.Item.Grammar
|
||||
import qualified IntMapHelp as IM
|
||||
import Data.IntMap.Merge.Strict
|
||||
import NewInt
|
||||
|
||||
-- assumes all item locations inside the items are correct
|
||||
@@ -48,10 +48,13 @@ crUpdateItemLocations crid lw = fromMaybe lw $ do
|
||||
crSetRoots :: Int -> LWorld -> LWorld
|
||||
crSetRoots cid w = fromMaybe w $ do
|
||||
inv <- w ^? creatures . ix cid . crInv
|
||||
-- invRootTrees inv
|
||||
return $ w & creatures . ix cid . crInv %~ merge dropMissing preserveMissing
|
||||
(zipWithMatched f)
|
||||
(invRootTrees inv)
|
||||
return $
|
||||
w & creatures . ix cid . crInv
|
||||
%~ merge
|
||||
dropMissing
|
||||
preserveMissing
|
||||
(zipWithMatched f)
|
||||
(invRootTrees inv)
|
||||
where
|
||||
f _ _ = itLocation . ilIsRoot .~ True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user