diff options
Diffstat (limited to 'src/Main.hs')
-rw-r--r-- | src/Main.hs | 8 |
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 | ||
16 | import Data.Default | 16 | import Data.Default |
17 | import Data.CaseInsensitive (CI) | 17 | import Data.CaseInsensitive (CI) |
18 | import qualified Data.CaseInsensitive | 18 | import qualified Data.CaseInsensitive as CI |
19 | 19 | ||
20 | import Data.Map.Strict (Map) | 20 | import Data.Map.Strict (Map) |
21 | import qualified Data.Map.Strict as Map | 21 | import qualified Data.Map.Strict as Map |
@@ -183,7 +183,8 @@ rollTest = withArg $ enactTest' >=> maybe (return ()) (shellPutStrLn . ppResult) | |||
183 | 183 | ||
184 | enactTest' :: (FormulaM Stats Test) -> Sh GameState (Maybe TestResult) | 184 | enactTest' :: (FormulaM Stats Test) -> Sh GameState (Maybe TestResult) |
185 | enactTest' test = withFocus' $ \focus -> do | 185 | enactTest' 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) |