From e8847f2aa01645afbe5989a938a2412157eba44e Mon Sep 17 00:00:00 2001 From: nek0 Date: Fri, 18 May 2018 20:05:21 +0200 Subject: [PATCH] foo --- src/NPC.hs | 4 ++-- src/Test.hs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/NPC.hs b/src/NPC.hs index cfab60f..78341cf 100644 --- a/src/NPC.hs +++ b/src/NPC.hs @@ -7,7 +7,7 @@ import Data.Ecstasy as E import Control.Monad.IO.Class (MonadIO(..)) import Control.Concurrent.MVar -import Control.Concurrent (forkIO) +import Control.Concurrent (forkOS) import Linear @@ -153,7 +153,7 @@ updateNPCs imgmat rp dt = else do ttl <- liftIO $ randomRIO (5, 30) future <- liftIO $ newEmptyMVar - _ <- liftIO $ forkIO $ getPath (fmap floor pos') future rp imgmat + _ <- liftIO $ forkOS $ getPath (fmap floor pos') future rp imgmat return $ unchanged { npcState = Set $ NPCStanding ttl future } diff --git a/src/Test.hs b/src/Test.hs index b09278c..8b08aaa 100644 --- a/src/Test.hs +++ b/src/Test.hs @@ -10,7 +10,7 @@ import NanoVG hiding (V2(..)) import Control.Monad (when, unless, void) import Control.Monad.IO.Class (liftIO) import Control.Concurrent.MVar -import Control.Concurrent (forkIO) +import Control.Concurrent (forkOS) import Data.Map.Strict as Map import qualified Data.Set as S @@ -41,7 +41,7 @@ loadMap = do let fc = FloorConfig (20, 20) [(5,5), (35, 35)] - (50,75) + (50, 50) (Subsystems _ m) = subsystems ud (mat, gr) <- liftIO $ buildHallFloorIO fc let imgmat = convertTileToImg mat @@ -57,7 +57,7 @@ loadMap = do liftIO $ logIO A.Debug ("number of reachpoints: " ++ show (length rps)) let nnex = Prelude.filter (\p -> pointType p /= RoomExit) rps liftIO $ A.logIO A.Debug $ "number of placed NPCs: " ++ show (length nnex) - npcposs <- placeNPCs inter mat rps gr (length nnex) + npcposs <- placeNPCs inter mat rps gr 50 -- (length nnex) (nws, _) <- liftIO $ yieldSystemT (worldState ud) $ do void $ createEntity $ newEntity { pos = Just (V2 20.5 20.5) @@ -68,7 +68,7 @@ loadMap = do -- ttl <- liftIO $ randomRIO (5, 30) fact <- liftIO $ randomRIO (0.5, 1.5) future <- liftIO $ newEmptyMVar - _ <- liftIO $ forkIO $ getPath (fmap floor npcpos) future nnex inter + _ <- liftIO $ forkOS $ getPath (fmap floor npcpos) future nnex inter createEntity $ newEntity { pos = Just (V2 (nr + 0.5) (nc + 0.5)) , vel = Just (V2 0 0)