X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fworld%2Fworld.cpp;h=8ea99fec247734e6b592c6e65fc231f9350a49c7;hb=5178dd1e226d45db7ae61e3d7d6866dc4254d9ae;hp=f648baad45c082da5139066bf7fed8f68e6a1334;hpb=a50aa0f2a2fea14f5f8c56209e2ecde3088ef913;p=blank.git diff --git a/src/world/world.cpp b/src/world/world.cpp index f648baa..8ea99fe 100644 --- a/src/world/world.cpp +++ b/src/world/world.cpp @@ -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); + } @@ -169,7 +167,6 @@ Player *World::AddPlayer(const std::string &name) { entity.Name(name); 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(); @@ -188,7 +185,6 @@ Player *World::AddPlayer(const std::string &name, std::uint32_t id) { entity->Name(name); 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();