This commit is contained in:
nek0 2018-05-18 20:05:21 +02:00
parent 2520ca3cf2
commit e8847f2aa0
2 changed files with 6 additions and 6 deletions

View file

@ -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
}

View file

@ -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)