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
+9 -8
View File
@@ -611,13 +611,14 @@ setOldPos cr = cr & crOldPos .~ _crPos cr
zoneCreatures :: World -> World
zoneCreatures w =
w & crZoning .~ foldl' zoneCreature mempty (IM.filter zonableCreature $ w ^. cWorld . lWorld . creatures)
-- w & crZoning .~ foldl' zoneCreature mempty (IM.filter zonableCreature $ w ^. cWorld . lWorld . creatures)
w & crZoning .~ foldl' zoneCreature mempty (w ^. cWorld . lWorld . creatures)
zonableCreature :: Creature -> Bool
zonableCreature cr = case cr ^. crHP of
HP{} -> True
CrIsCorpse{} -> True
CrDestroyed{} -> False
--zonableCreature :: Creature -> Bool
--zonableCreature cr = case cr ^. crHP of
-- HP{} -> True
-- CrIsCorpse{} -> True
-- AvatarDestroyed{} -> False
updateCreatureSoundPositions :: World -> World
updateCreatureSoundPositions w =
@@ -1005,7 +1006,7 @@ canSpring cr =
cr ^. crPos . _z >= 0 && case cr ^. crHP of
HP{} -> True
CrIsCorpse{} -> True
CrDestroyed{} -> False
AvatarDestroyed{} -> False
crCrSpring :: Creature -> Creature -> World -> World
crCrSpring c1 c2
@@ -1087,7 +1088,7 @@ feedSlime s c w = fromMaybe w $ do
& slimeSuck s c
else
w
& cWorld . lWorld . creatures . ix (c ^. crID) . crHP .~ CrDestroyed Swallowed
& cWorld . lWorld . creatures . at (c ^. crID) %~ destroyCreature
& cWorld . lWorld . creatures . ix (s ^. crID) %~ f
& slimeEatSound (s ^. crID) (s ^. crPos . _xy)
where