Move machine destruction to external function

This commit is contained in:
2022-07-14 12:48:52 +01:00
parent 79791d0df2
commit f05d284312
7 changed files with 57 additions and 23 deletions
+6 -4
View File
@@ -12,8 +12,9 @@ import Dodge.CullBox
--import Dodge.Block
import Dodge.Distortion
import Dodge.SoundLogic
import Dodge.Wall.Delete
--import Dodge.Wall.Delete
import Dodge.Update.WallDamage
import Dodge.Machine.Destroy
--import Dodge.Menu
import Dodge.Base
import Dodge.Zone
@@ -127,9 +128,10 @@ updateWorldSelect w = f . g $ case (w ^? mouseButtons . ix ButtonLeft, w ^? mous
mcChooseUpdate :: Machine -> Machine -> World -> World
mcChooseUpdate mc mc'
| _mcHP mc > 0 = _mcUpdate mc mc'
| otherwise = (machines %~ IM.delete (_mcID mc))
. deleteWallIDs (_mcWallIDs mc)
. _mcDeath mc mc'
| otherwise = destroyMachine mc
-- (machines %~ IM.delete (_mcID mc))
-- . deleteWallIDs (_mcWallIDs mc)
-- . _mcDeath mc mc'
tmUpdate :: Terminal -> World -> World
tmUpdate tm w = case w ^? terminals . ix (_tmID tm) . tmFutureLines . ix 0 of