We are the wooooorld, we are the childreeen

This commit is contained in:
MarcEricMartel 2023-10-29 15:07:01 -04:00
parent 4f64be7e0a
commit b50a2f44e2
2 changed files with 3 additions and 2 deletions

View File

@ -9,7 +9,7 @@ Array2d<Chunk*>& World::GetChunks() { return m_chunks; }
void World::BuildWorld() { void World::BuildWorld() {
for (int x = 0; x < WORLD_SIZE_X; ++x) for (int x = 0; x < WORLD_SIZE_X; ++x)
for (int y = 0; y < WORLD_SIZE_Y; ++y) 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) { void World::SetSeed(uint64_t seed) {

View File

@ -182,7 +182,8 @@ void Server::Run() {
m_world = std::make_unique<World>(); m_world = std::make_unique<World>();
m_world->SetSeed(m_game.seed); 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. 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)); conn->player = std::make_unique<Player>(Vector3f(8.5f, CHUNK_SIZE_Y + 1.8f, 8.5f));