Continue removing LDTs
This commit is contained in:
@@ -65,15 +65,15 @@ checkConnection :: SoundOrigin -> SoundID -> Int -> Int -> World -> World
|
||||
checkConnection so s i j w = fromMaybe w $ do
|
||||
inv <- w ^? cWorld . lWorld . creatures . ix 0 . crInv
|
||||
cpos <- w ^? cWorld . lWorld . creatures . ix 0 . crPos
|
||||
let locs = allInvLocs inv
|
||||
let locs = invIndents inv -- why indents?
|
||||
iit <- locs ^? ix i . _2
|
||||
jit <- locs ^? ix j . _2
|
||||
guard $ isConnected iit || isConnected jit
|
||||
return $ soundStart so cpos s Nothing w
|
||||
|
||||
isConnected :: LocationLDT b a -> Bool
|
||||
isConnected x = case x ^. locLdtContext of
|
||||
TopLDT ->
|
||||
not (null $ x ^. locLDT . ldtRight)
|
||||
|| not (null $ x ^. locLDT . ldtLeft)
|
||||
isConnected :: LocationDT a -> Bool
|
||||
isConnected x = case x ^. locDtContext of
|
||||
TopDT ->
|
||||
not (null $ x ^. locDT . dtRight)
|
||||
|| not (null $ x ^. locDT . dtLeft)
|
||||
_ -> True
|
||||
|
||||
Reference in New Issue
Block a user