Change foldr to foldl' in some cases
This commit is contained in:
+2
-2
@@ -151,11 +151,11 @@ zoneCreatures w = w
|
||||
cid = _crID cr
|
||||
|
||||
updateCreatureSoundPositions :: World -> World
|
||||
updateCreatureSoundPositions w = M.foldrWithKey insertSound w
|
||||
updateCreatureSoundPositions w = M.foldlWithKey' insertSound w
|
||||
. M.mapMaybeWithKey updateSound
|
||||
$ _playingSounds w
|
||||
where
|
||||
insertSound k s = toPlaySounds %~ M.insertWith (const id) k s
|
||||
insertSound w' k s = w' & toPlaySounds %~ M.insertWith (const id) k s
|
||||
updateSound (CrMouth cid) s = case w ^? creatures . ix cid . crPos of
|
||||
Just p -> Just s {_soundPos = p, _soundAngDist = Just (soundAngle p w,0)}
|
||||
Nothing -> Just s {_soundTime = Just 0}
|
||||
|
||||
Reference in New Issue
Block a user