Fix space leak when assigning targeted creature
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
--{-# LANGUAGE TupleSections #-}
|
||||
module Dodge.Creature.Perception
|
||||
( perceptionUpdate
|
||||
, perceptionUp
|
||||
, perceptionUpdate'
|
||||
, newSounds
|
||||
)
|
||||
@@ -36,6 +37,12 @@ perceptionUpdate'
|
||||
-> Creature
|
||||
-> Creature
|
||||
perceptionUpdate' is w cr = rememberSounds' w $ basicAwarenessUpdate' $ basicAttentionUpdate' is w cr
|
||||
--perceptionUpdate' is w cr = basicAwarenessUpdate' $ basicAttentionUpdate' is w cr
|
||||
|
||||
perceptionUp :: Int -> World -> Creature -> Creature
|
||||
perceptionUp i w cr | canSee i (_crID cr) w = cr & crPerception . crAwarenessLevel . at i ?~ Cognizant 100
|
||||
| otherwise = cr & crPerception . crAwarenessLevel . at i .~ Nothing
|
||||
|
||||
|
||||
{- | Update a creatures awareness based upon the creatures' current direction
|
||||
of attention -}
|
||||
|
||||
Reference in New Issue
Block a user