Commit before changing ItemUse into single product type
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
module Dodge.Creature.Impulse.UseItem (
|
||||
useRootItem,
|
||||
useSelectedItem,
|
||||
) where
|
||||
|
||||
import Control.Lens
|
||||
@@ -16,11 +16,13 @@ import Dodge.Item.Grammar
|
||||
import Dodge.Item.Location
|
||||
import qualified IntMapHelp as IM
|
||||
|
||||
useRootItem :: Int -> World -> World
|
||||
useRootItem crid w = (worldEventFlags . at InventoryChange ?~ ()) . fromMaybe w $ do
|
||||
useSelectedItem :: Int -> World -> World
|
||||
useSelectedItem crid w = (worldEventFlags . at InventoryChange ?~ ()) . fromMaybe w $ do
|
||||
cr <- w ^? cWorld . lWorld . creatures . ix crid
|
||||
itRef <- cr ^? crManipulation . manObject . imRootSelectedItem
|
||||
invid <- cr ^? crManipulation . manObject . imSelectedItem
|
||||
itmtree <- invRootTrees (_crInv cr) ^? ix itRef
|
||||
itmloc <- allInvLocs (_crInv cr) ^? ix invid
|
||||
let itm = itmtree ^. ldtValue . _1
|
||||
case itmtree ^. ldtValue . _2 of
|
||||
HeldPlatformSF ->
|
||||
|
||||
Reference in New Issue
Block a user