Fix bug in creature death drop/destruction ordering

This commit is contained in:
2024-10-03 11:19:53 +01:00
parent 1953fb2d0c
commit 3c9941923d
6 changed files with 17 additions and 102 deletions
+8 -8
View File
@@ -71,14 +71,14 @@ stateUpdate f =
]
checkDeath :: Creature -> World -> World
checkDeath cr
| _crHP cr > 0 =
cWorld . lWorld . creatures . ix (_crID cr) . crState . csDamage .~ []
| otherwise =
dropByState cr
. removecr
. stopSoundFrom (CrWeaponSound (_crID cr) 0)
. corpseOrGib cr
checkDeath cr w
| _crHP cr > 0 = w
& cWorld . lWorld . creatures . ix (_crID cr) . crState . csDamage .~ []
| otherwise = w
& dropByState cr -- the order of
& removecr -- these is important
& stopSoundFrom (CrWeaponSound (_crID cr) 0)
& corpseOrGib cr
where
removecr
| _crID cr == 0 =