a little optimization

This commit is contained in:
nek0 2018-08-01 17:54:49 +02:00
parent b89fe75a39
commit 5e8df5a022
2 changed files with 4 additions and 2 deletions

View file

@ -111,7 +111,9 @@ placeHalls rng fc input =
(nbs, nmat) = buildHall cross 3 b amat (nbs, nmat) = buildHall cross 3 b amat
in in
-- if hallRatio nmat < 0.33 && wmax - 1 >= 2 -- if hallRatio nmat < 0.33 && wmax - 1 >= 2
if wmax - 1 >= 3 if wmax - 1 >= 3 &&
all (\(Boundaries (minr, minc) (maxr, maxc)) ->
maxr - minr > 3 && maxc - minc > 3) nbs
then doHalls g2 nbs (row, col) (wmax -1) nmat then doHalls g2 nbs (row, col) (wmax -1) nmat
else (g2, nmat) else (g2, nmat)
) (rand, mat) bs ) (rand, mat) bs

View file

@ -99,7 +99,7 @@ loadMapFork ud future progress = do
_ <- liftIO $ swapMVar progress (13 / loadSteps, "Placing NPCs") _ <- liftIO $ swapMVar progress (13 / loadSteps, "Placing NPCs")
logIO A.Debug ("number of reachpoints: " ++ show (length rps)) logIO A.Debug ("number of reachpoints: " ++ show (length rps))
let nnex = Prelude.filter (\p -> pointType p /= RoomExit) rps let nnex = Prelude.filter (\p -> pointType p /= RoomExit) rps
npcposs <- placeNPCs inter mat rps 50 -- (length $ filter (\a -> pointType a == Table) nnex) npcposs <- placeNPCs inter mat rps 25 -- (length $ filter (\a -> pointType a == Table) nnex)
_ <- liftIO $ swapMVar progress (14 / loadSteps, "Preparing MindMap graph") _ <- liftIO $ swapMVar progress (14 / loadSteps, "Preparing MindMap graph")
A.logIO A.Debug $ "number of placed NPCs: " ++ show (length npcposs) A.logIO A.Debug $ "number of placed NPCs: " ++ show (length npcposs)
!(mmintmat, mmgraph) <- buildFloorMap . springField <$> !(mmintmat, mmgraph) <- buildFloorMap . springField <$>