]> git.localhorst.tv Git - blank.git/blobdiff - src/world/world.cpp
read preferences from user config file
[blank.git] / src / world / world.cpp
index e659322aa333c753fd953a718fc0c18b7eace276..8ea99fec247734e6b592c6e65fc231f9350a49c7 100644 (file)
@@ -145,8 +145,6 @@ World::World(const BlockTypeRegistry &types, const Config &config)
 : config(config)
 , block_type(types)
 , chunks(types)
-// TODO: set spawn base and extent from config
-, spawn_index(chunks.MakeIndex(Chunk::Pos(0, 0, 0), 3))
 , players()
 , entities()
 , light_direction(config.light_direction)
@@ -155,7 +153,7 @@ World::World(const BlockTypeRegistry &types, const Config &config)
 }
 
 World::~World() {
-       chunks.UnregisterIndex(spawn_index);
+
 }
 
 
@@ -167,10 +165,8 @@ Player *World::AddPlayer(const std::string &name) {
        }
        Entity &entity = AddEntity();
        entity.Name(name);
-       // TODO: load from save file here
        entity.Bounds({ { -0.5f, -0.5f, -0.5f }, { 0.5f, 0.5f, 0.5f } });
        entity.WorldCollidable(true);
-       entity.Position(config.spawn);
        ChunkIndex &index = chunks.MakeIndex(entity.ChunkCoords(), 6);
        players.emplace_back(entity, index);
        return &players.back();
@@ -187,10 +183,8 @@ Player *World::AddPlayer(const std::string &name, std::uint32_t id) {
                return nullptr;
        }
        entity->Name(name);
-       // TODO: load from save file here
        entity->Bounds({ { -0.5f, -0.5f, -0.5f }, { 0.5f, 0.5f, 0.5f } });
        entity->WorldCollidable(true);
-       entity->Position(config.spawn);
        ChunkIndex &index = chunks.MakeIndex(entity->ChunkCoords(), 6);
        players.emplace_back(*entity, index);
        return &players.back();