summaryrefslogtreecommitdiff
path: root/src/Main.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Main.hs')
-rw-r--r--src/Main.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Main.hs b/src/Main.hs
index 145df7a..b7c6a6e 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -15,7 +15,7 @@ import System.Directory
15 15
16import Data.Default 16import Data.Default
17import Data.CaseInsensitive (CI) 17import Data.CaseInsensitive (CI)
18import qualified Data.CaseInsensitive 18import qualified Data.CaseInsensitive as CI
19 19
20import Data.Map.Strict (Map) 20import Data.Map.Strict (Map)
21import qualified Data.Map.Strict as Map 21import qualified Data.Map.Strict as Map
@@ -183,7 +183,8 @@ rollTest = withArg $ enactTest' >=> maybe (return ()) (shellPutStrLn . ppResult)
183 183
184enactTest' :: (FormulaM Stats Test) -> Sh GameState (Maybe TestResult) 184enactTest' :: (FormulaM Stats Test) -> Sh GameState (Maybe TestResult)
185enactTest' test = withFocus' $ \focus -> do 185enactTest' test = withFocus' $ \focus -> do
186 (newFocus, result) <- evalFormula focus (enactTest =<< test) 186 focusName <- use gFocus >>= toName . fromJust
187 (newFocus, result) <- evalFormula focusName focus (enactTest =<< test)
187 gFocus' .= newFocus 188 gFocus' .= newFocus
188 return result 189 return result
189 190
@@ -200,5 +201,6 @@ entitySeqVal' ident = do
200 case (,) <$> entity <*> sVal of 201 case (,) <$> entity <*> sVal of
201 Nothing -> return () 202 Nothing -> return ()
202 Just (entity, sVal) -> do 203 Just (entity, sVal) -> do
203 (newEntity, view (seqVal . re _Just) -> val) <- evalFormula entity sVal 204 name <- toName ident
205 (newEntity, view (seqVal . re _Just) -> val) <- evalFormula name entity sVal
204 gEntities . at ident .= Just (newEntity & set eSeqVal val) 206 gEntities . at ident .= Just (newEntity & set eSeqVal val)