Fix no damage to walls bug

This commit is contained in:
2022-07-28 18:57:53 +01:00
parent ec4ff84c46
commit c8ad3e1294
19 changed files with 177 additions and 158 deletions
+7
View File
@@ -1,5 +1,6 @@
module Dodge.Machine.Destroy where
import Dodge.FloorItem
import Data.Maybe
import Dodge.Data.World
import Dodge.Wall.Delete
@@ -15,6 +16,12 @@ destroyMachine mc =
. makeExplosionAt (_mcPos mc)
. mcKillTerm mc
. mcKillBut mc
. destroyMcType (mc ^. mcType) mc
destroyMcType :: MachineType -> Machine -> World -> World
destroyMcType mt mc = case mt of
McTurret tu -> copyItemToFloor (_mcPos mc) (_tuWeapon tu)
_ -> id
mcKillTerm :: Machine -> World -> World
mcKillTerm mc w = fromMaybe w $ do