Cleanup/remove trigger types code

This commit is contained in:
2024-10-03 11:39:12 +01:00
parent 3c9941923d
commit ce2f13ade3
8 changed files with 157 additions and 275 deletions
+1 -1
View File
@@ -114,7 +114,7 @@ internalCreatureUpdate cr =
TODO make sure this doesn't mess up any ItemPosition
-}
dropByState :: Creature -> World -> World
dropByState cr w = foldr (dropItem cr) w $ case cr ^. crState . csDropsOnDeath of
dropByState cr w = foldl' (flip (dropItem cr)) w $ case cr ^. crState . csDropsOnDeath of
DropAll -> IM.keys $ _crInv cr
DropSpecific xs -> xs
DropAmount n -> take n $ evalState (shuffle $ IM.keys $ _crInv cr) (_randGen w)