Remove loop dependency on loading dodge sounds

This commit is contained in:
2021-03-27 13:42:14 +01:00
parent 2897c65e9e
commit 2011728de5
10 changed files with 171 additions and 153 deletions
+3 -1
View File
@@ -6,6 +6,8 @@ import Dodge.Default
import Dodge.CreatureState
import Dodge.LightSources
import Dodge.WorldEvent.Sound
import Dodge.Creature.Update hiding (CRUpdate)
import Picture
@@ -30,7 +32,7 @@ updateLamp :: Int -> CRUpdate
updateLamp i = unrandUpdate handleLS internalUpdate
where
handleLS cr w
| _crHP cr < 0 = w & lightSources %~ IM.delete i
| _crHP cr < 0 = mkSoundBreakGlass w & lightSources %~ IM.delete i
| otherwise = w & lightSources . ix i . lsPos .~ _crPos cr
internalUpdate cr
| _crHP cr < 0 = Nothing