Cleanup, trying to diagnose space leak in crit update
This commit is contained in:
@@ -33,7 +33,6 @@ import Control.Monad.State
|
||||
import System.Random
|
||||
--import qualified Data.Set as S
|
||||
--import qualified Data.Map as M
|
||||
import Data.Monoid
|
||||
import qualified Data.Vector as V
|
||||
import qualified Data.Vector.Mutable as MV
|
||||
|
||||
@@ -42,13 +41,14 @@ import qualified Data.Vector.Mutable as MV
|
||||
-- the creature before or after it has moved?
|
||||
-- currently invSideEffects are applied after the creature moves, to correctly
|
||||
-- update shield positions
|
||||
stateUpdate :: CRUpdate -> CRUpdate
|
||||
stateUpdate = stateUpdateDamage doDamage
|
||||
stateUpdate :: CRUpdate -> Creature -> World -> World
|
||||
stateUpdate f cr w = let (fw,mcr) = stateUpdateDamage doDamage f cr w
|
||||
in fw $ w & creatures . at (_crID cr) .~ mcr
|
||||
|
||||
stateUpdateDamage :: (Creature -> Creature) -> CRUpdate -> CRUpdate
|
||||
stateUpdateDamage damageupdate u cr w = case u (updateMovement cr) w of
|
||||
(f, maybeCr) ->
|
||||
( Endo $ invSideEff (fromMaybe cr maybeCr) . movementSideEff cr . deathEff . appEndo f
|
||||
( invSideEff (fromMaybe cr maybeCr) . movementSideEff cr . deathEff . f
|
||||
, fmap (stepReloading . damageupdate) $ crOrCorpse =<< maybeCr
|
||||
)
|
||||
where
|
||||
|
||||
Reference in New Issue
Block a user