SQC-15_online #1
@ -9,7 +9,7 @@ Array2d<Chunk*>& World::GetChunks() { return m_chunks; }
|
||||
void World::BuildWorld() {
|
||||
for (int x = 0; x < WORLD_SIZE_X; ++x)
|
||||
for (int y = 0; y < WORLD_SIZE_Y; ++y)
|
||||
m_chunks.Set(x - m_center[0], y - m_center[1], new Chunk(x + m_center[0], y + m_center[1], m_seed));
|
||||
m_chunks.Set(x, y, new Chunk(x + m_center[0], y + m_center[1], m_seed));
|
||||
}
|
||||
|
||||
void World::SetSeed(uint64_t seed) {
|
||||
|
@ -182,7 +182,8 @@ void Server::Run() {
|
||||
|
||||
m_world = std::make_unique<World>();
|
||||
m_world->SetSeed(m_game.seed);
|
||||
//m_world->BuildWorld();
|
||||
m_world->GetChunks().Reset(nullptr);
|
||||
m_world->BuildWorld();
|
||||
|
||||
for (auto& [key, conn] : m_players) { // Creation des instances de joueurs et premier sync.
|
||||
conn->player = std::make_unique<Player>(Vector3f(8.5f, CHUNK_SIZE_Y + 1.8f, 8.5f));
|
||||
|
Loading…
Reference in New Issue
Block a user