X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fapp%2FServerState.cpp;h=0be565307308ce330b9a38d793b2be1a5496dc3b;hb=d4c71969df4f6b5e6b750c98268d30ca6784908b;hp=c2163ad161976124f08b5bbcfc3cf1dba450d826;hpb=43820582217f7e4b707d98f2e69d969eb77fc7c3;p=blank.git diff --git a/src/app/ServerState.cpp b/src/app/ServerState.cpp index c2163ad..0be5653 100644 --- a/src/app/ServerState.cpp +++ b/src/app/ServerState.cpp @@ -11,15 +11,18 @@ namespace blank { ServerState::ServerState( HeadlessEnvironment &env, + const Generator::Config &gc, const World::Config &wc, const WorldSave &ws, const Server::Config &sc ) : env(env) , block_types() -, world(block_types, wc, ws) +, world(block_types, wc) +, generator(gc) +, chunk_loader(world.Chunks(), generator, ws) , skeletons() -, spawner(world, skeletons, wc.gen.seed) +, spawner(world, skeletons, gc.seed) , server(sc, world) , push_timer(16) { TextureIndex tex_index; @@ -43,9 +46,8 @@ void ServerState::Update(int dt) { push_timer.Update(dt); server.Handle(); spawner.Update(dt); - if (!world.Players().empty()) { - world.Update(dt); - } + world.Update(dt); + chunk_loader.Update(dt); if (push_timer.Hit()) { server.Update(dt); }