Remove destroyed creatures rather than setting flag

Sill only set flag for avatar
This commit is contained in:
2026-05-08 10:45:05 +01:00
parent 84e95da2b5
commit ad998fb622
7 changed files with 26 additions and 18 deletions
+2 -2
View File
@@ -30,7 +30,7 @@ updateExpBarrel ps cr w = case cr ^. crHP of
HP _ ->
w
& makeExplosionAt (CrIndirectO (cr ^. crID)) ((cr ^. crPos) & _z +~ 20) 0
& cWorld . lWorld . creatures . ix (_crID cr) . crHP .~ CrDestroyed Gibbed
& cWorld . lWorld . creatures . at (_crID cr) .~ Nothing
_ -> w
where
f w' p = makeSpark NormalSpark (p + normalizeV p + cr ^. crPos . _xy) (argV p) w'
@@ -43,7 +43,7 @@ updateExpBarrel ps cr w = case cr ^. crHP of
updateBarrel :: Creature -> World -> World
updateBarrel cr = case cr ^. crHP of
HP x | x > 0 -> doDamage (cr ^. crID)
HP _ -> cWorld . lWorld . creatures . ix (_crID cr) . crHP .~ CrDestroyed Gibbed
HP _ -> cWorld . lWorld . creatures . at (_crID cr) .~ Nothing
_ -> id
damsToExpBarrel :: [Damage] -> Creature -> Creature