Major item refactor, still broken
This commit is contained in:
@@ -48,7 +48,7 @@ swapInvItems f i w = fromMaybe w $ do
|
||||
. swapSite i k
|
||||
. swapSite k i
|
||||
cr = you w
|
||||
swapSite a b = case cr ^? crInv . ix a . itLocation . ilEquipSite . _Just of
|
||||
swapSite a b = case cr ^? crInv . ix a >>= \k -> w ^? cWorld . lWorld . items . ix k . itLocation . ilEquipSite . _Just of
|
||||
Just epos -> crEquipment . ix epos .~ b
|
||||
Nothing -> id
|
||||
|
||||
@@ -63,8 +63,9 @@ swapAnyExtraSelection i k w = fromMaybe w $ do
|
||||
|
||||
checkConnection :: SoundOrigin -> SoundID -> Int -> Int -> World -> World
|
||||
checkConnection so s i j w = fromMaybe w $ do
|
||||
inv <- w ^? cWorld . lWorld . creatures . ix 0 . crInv
|
||||
inv' <- w ^? cWorld . lWorld . creatures . ix 0 . crInv
|
||||
cpos <- w ^? cWorld . lWorld . creatures . ix 0 . crPos
|
||||
let inv = fmap (\k -> w ^?! cWorld . lWorld . items . ix k) inv'
|
||||
let locs = invIndents inv -- why indents?
|
||||
iit <- locs ^? ix i . _2
|
||||
jit <- locs ^? ix j . _2
|
||||
|
||||
Reference in New Issue
Block a user